Skip to content

Commit

Permalink
chore: Updated jenkins job to export RDS deadlocks to datadog
Browse files Browse the repository at this point in the history
  • Loading branch information
syedimranhassan committed Oct 21, 2024
1 parent 440cd37 commit 417d9fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 2 additions & 4 deletions devops/jobs/ExportRDSDeadLocks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExportRDSDeadLocks {
wrappers {
credentialsBinding {
usernamePassword("USERNAME", "PASSWORD", "${deployment}-${environment}-export-dead-locks-credentials")
usernamePassword("SPLUNKUSERNAME", "SPLUNKPASSWORD", "export-dead-locks-splunk-credentials")
string("DDAPIKEY", "datadog_api_key")
def variable = "${deployment}-export-dead-locks"
string("ROLE_ARN", variable)
}
Expand All @@ -33,7 +33,7 @@ class ExportRDSDeadLocks {
cron("H H * * *")
}

def INDEXNAME = "${environment}-${deployment}"
def INDEXNAME = "edx-logs"

def rdsignore = ""
extraVars.get('IGNORE_LIST').each { ignore ->
Expand All @@ -48,8 +48,6 @@ class ExportRDSDeadLocks {
environmentVariables {
env('AWS_DEFAULT_REGION', extraVars.get('REGION'))
env('ENVIRONMENT', environment)
env('HOSTNAME', extraVars.get('SPLUNKHOSTNAME'))
env('PORT', extraVars.get('PORT'))
env('INDEXNAME', INDEXNAME)
env('RDSIGNORE', rdsignore)
env('WHITELISTREGIONS', whitelistregions)
Expand Down
9 changes: 8 additions & 1 deletion devops/resources/export-dead-locks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ if [[ ! -v WHITELISTREGIONS ]]; then
WHITELISTREGIONS=""
fi

python export_dead_locks.py --environment ${ENVIRONMENT} --hostname ${HOSTNAME} --port ${PORT} --indexname ${INDEXNAME} ${RDSIGNORE} ${WHITELISTREGIONS}
# Check if ENVIRONMENT is set to "stage"
# As we have "stg" in datadog and "stage" in the configuration
if [[ "$ENVIRONMENT" == "stage" ]]; then
# Update ENVIRONMENT to "stg"
ENVIRONMENT="stg"
fi

python export_dead_locks_dd.py --environment ${ENVIRONMENT} --indexname ${INDEXNAME} ${RDSIGNORE} ${WHITELISTREGIONS}

0 comments on commit 417d9fd

Please sign in to comment.