Skip to content

Commit

Permalink
Adding logs backup variable (#147)
Browse files Browse the repository at this point in the history
* adding logs backup variable

* filter pattern
  • Loading branch information
paigerube14 authored Oct 12, 2023
1 parent bce4e52 commit 6d4dac2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ telemetry:
max_retries: $TELEMETRY_MAX_RETRIES # maximum number of upload retries (if 0 will retry forever)
run_tag: $TELEMETRY_RUN_TAG # if set, this will be appended to the run folder in the bucket (useful to group the runs)
archive_size: $TELEMETRY_ARCHIVE_SIZE # the size of the prometheus data archive size in KB. The lower the size of archive is
logs_backup: $TELEMETRY_LOGS_BACKUP
logs_filter_patterns: $TELEMETRY_FILTER_PATTERN
oc_cli_path: $TELEMETRY_CLI_PATH # optional, if not specified will be search in $PATH
3 changes: 3 additions & 0 deletions docs/all_scenarios_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ TELEMETRY_ARCHIVE_PATH | local path where the archive files will be temporarly s
TELEMETRY_MAX_RETRIES | maximum number of upload retries (if 0 will retry forever) | 0 |
TELEMETRY_RUN_TAG | if set, this will be appended to the run folder in the bucket (useful to group the runs | chaos |
TELEMETRY_ARCHIVE_SIZE | the size of the prometheus data archive size in KB. The lower the size of archive is | 1000 |
TELEMETRY_LOGS_BACKUP | Logs backup to s3 | False |
TELEMETRY_FILTER_PATTER | Filter logs based on certain time stamp patterns |["(\\w{3}\\s\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d+).+","kinit (\\d+/\\d+/\\d+\\s\\d{2}:\\d{2}:\\d{2})\\s+","(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+Z).+"] |
TELEMETRY_CLI_PATH | OC Cli path, if not specified will be search in $PATH | _blank_ |

**NOTE**: For setting the TELEMETRY_ARCHIVE_SIZE,the higher the number of archive files will be produced and uploaded (and processed by backup_thread simultaneously).For unstable/slow connection is better to keep this value low increasing the number of backup_threads, in this way, on upload failure, the retry will happen only on the failed chunk without affecting the whole upload.
3 changes: 3 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export TELEMETRY_ARCHIVE_PATH=${TELEMETRY_ARCHIVE_PATH:=/tmp}
export TELEMETRY_MAX_RETRIES=${TELEMETRY_MAX_RETRIES:=0}
export TELEMETRY_RUN_TAG=${TELEMETRY_RUN_TAG:=chaos}
export TELEMETRY_ARCHIVE_SIZE=${TELEMETRY_ARCHIVE_SIZE:=1000}
export TELEMETRY_LOGS_BACKUP=${TELEMETRY_LOGS_BACKUP:=False}
export TELEMETRY_FILTER_PATTERN=${TELEMETRY_FILTER_PATTERN:='["(\\w{3}\\s\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d+).+","kinit (\\d+/\\d+/\\d+\\s\\d{2}:\\d{2}:\\d{2})\\s+","(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+Z).+"]'}
export TELEMETRY_CLI_PATH=${TELEMETRY_CLI_PATH:=""}

# Unset KUBECONFIG to make sure mounted kubeconfig is used
unset KUBECONFIG
2 changes: 1 addition & 1 deletion prow/namespace-scenarios/prow_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ source service-disruption-scenarios/env.sh
krkn_loc=/root/kraken

# Substitute config with environment vars defined
export SCENARIO_FILE="- service-disruption-scenarios/service-disruption_scenario.yaml"
export SCENARIO_FILE="- service-disruption-scenarios/service_disruption_scenario.yaml"
envsubst < service-disruption-scenarios/namespace_scenario.yaml.template > service-disruption-scenarios/service_disruption_scenario.yaml
envsubst < config.yaml.template > service_disruption_config.yaml

Expand Down

0 comments on commit 6d4dac2

Please sign in to comment.