Skip to content

Commit

Permalink
chore: Added Datadog heartbeat metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
syedimranhassan committed Sep 4, 2024
1 parent bc06027 commit 99b13d1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion devops/jobs/CheckASGLifeCycleHooks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class CheckASGLifeCycleHooks {
"metric": "${datadog_heartbeat_name}",
"points": [['\$(date +%s)', 1]],
"type": "gauge",
"tags": ["env:${deployment}", "app:check-asg-lifecycle-hooks"]
"tags": ["env:${deployment}"]
}]
}
"""
Expand Down
1 change: 1 addition & 0 deletions devops/jobs/CheckTableSize.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CheckTableSize {
def variable = "${deployment}-table-size-monitoring"
string("ROLE_ARN", variable)
string("GENIE_KEY", "opsgenie_heartbeat_key")
string("DD_KEY", "datadog_heartbeat_key")
}
}

Expand Down
1 change: 1 addition & 0 deletions devops/jobs/Janitor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Janitor {
env('AWS_CLEANER', configuration.get('aws_cleaner'))
env('DENY_LIST', configuration.get('deny_list'))
env('NOOP', extraVars.get('NOOP', false))
env('DEPLOYMENT', deployment)
}


Expand Down
2 changes: 2 additions & 0 deletions devops/jobs/ProspectusJanitor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ProspectusJanitor {
credentialsBinding {
string('ROLE_ARN', "tools-jenkins-janitor-${deployment}-role-arn")
string("GENIE_KEY", "opsgenie_heartbeat_key")
string("DD_KEY", "datadog_heartbeat_key")
}
}

Expand Down Expand Up @@ -100,6 +101,7 @@ class ProspectusJanitor {
env('AWS_REGION', configuration.get('aws_region', 'us-east-1'))
env('AWS_CLEANER', configuration.get('aws_cleaner'))
env('NOOP', extraVars.get('NOOP', false))
env('DEPLOYMENT', deployment)
}


Expand Down
2 changes: 1 addition & 1 deletion devops/resources/janitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ curl -X POST "https://api.datadoghq.com/api/v1/series?api_key=${DD_KEY}" \
"metric": '${JOB_NAME##*/}".heartbeat"',
"points": [['"$(date +%s)"', 1]],
"type": "gauge",
"tags": ["env:edge", "app:minos"]
"tags": ["env:'${DEPLOYMENT}'"]
}]
}'
10 changes: 10 additions & 0 deletions devops/resources/table-size-monitoring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ fi
python check_table_size.py --threshold ${THRESHOLD} ${RDSTHRESHOLD} ${RDSIGNORE}

curl -X GET 'https://api.opsgenie.com/v2/heartbeats/table-size-monitoring-'${DEPLOYMENT}'/ping' -H 'Authorization: GenieKey '${GENIE_KEY}
curl -X POST "https://api.datadoghq.com/api/v1/series?api_key=${DD_KEY}" \
-H "Content-Type: application/json" \
-d '{
"series" : [{
"metric": "table-size-monitoring-"'${DEPLOYMENT}".heartbeat"',
"points": [['"$(date +%s)"', 1]],
"type": "gauge",
"tags": ["env:'${DEPLOYMENT}'"]
}]
}'

0 comments on commit 99b13d1

Please sign in to comment.