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 cf5d726 commit 9fc52d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions devops/jobs/Janitor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Janitor {
credentialsBinding {
string('ROLE_ARN', "tools-jenkins-janitor-${deployment}-role-arn")
string("GENIE_KEY", "opsgenie_heartbeat_key")
string("DD_KEY", "datadog_heartbeat_key")
}
}

Expand Down
10 changes: 10 additions & 0 deletions devops/resources/janitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ else
fi

curl -X GET 'https://api.opsgenie.com/v2/heartbeats/'${JOB_NAME##*/}'/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": '${JOB_NAME##*/}+".heartbeat"',
"points": [['"$(date +%s)"', 1]],
"type": "gauge",
"tags": ["env:edge", "app:minos"]
}]
}'

0 comments on commit 9fc52d2

Please sign in to comment.