Integrate alerts from Prometheus Alertmanager into Dynatrace.
The prometheus alertmanager extensions allows you to run a Prometheus Alertmanager Webhook on a Dynatrace ActiveGate. This webhook can receive Alertmanager alerts and forward them to Dynatrace Custom Devices as problems.
The Extension must be installed both on an ActiveGate and on the Dynatrace Cluster. See Deploy an extension in our full documentation for more details.
Extract the extension zip file to the plugin_deployment
folder at the root of the remote plugin module.
Linux:
unzip -o -d /opt/dynatrace/remotepluginmodule/plugin_deployment custom.remote.python.dynatrace_alertmanager_receiver.zip
/opt/dynatrace
Windows:
%PROGRAMFILES%\dynatrace\remotepluginmodule\plugin_deployment
%PROGRAMFILES%\dynatrace
Upload the same extension zip file to your tenant. The Extension configuration and upload UI is located at:
Settings > Monitored technologies > Custom extensions > Upload extension
Create an endpoint under Settings > Monitored technologies > Custom extensions > Alertmanager Receiver
The parameters are:
httpss://localhost:9999/e/<environment_id>
The webhook can be tested locally with a curl command, like so:
curl -i 'http://localhost:9393/webhook' \
-d '{
"receiver":"dynatrace-receiver",
"status":"firing",
"alerts":[
{
"status":"firing",
"labels":{
"alertname":"TargetDown",
"job":"kubelet",
"namespace":"kube-system",
"prometheus":"kubelet",
"service":"kubelet",
"severity":"warning"
},
"annotations":{
"message":"11.11% of the kubelet/kubelet targets in kube-system"
},
"startsAt":"2021-03-19T01:35:45.72Z",
"endsAt":"0001-01-01T00:00:00Z",
"generatorURL":"http://openshift.com",
"fingerprint":"e425bb91067b6c9e"
}
],
"groupKey":"{}:{\"alertname\": \"Test Alert\", \"cluster\": \"Cluster 02\", \"service\": \"Service 01\"}",
"groupLabels":{
"alertname":"Test Alert",
"cluster":"Cluster 02",
"service":"Service 02"
},
"commonLabels":{
"alertname":"Test Alert",
"cluster":"Cluster 02",
"service":"Service 02"
},
"commonAnnotations":{
"annotation_01":"annotation 01",
"annotation_02":"annotation 03"
},
"externalURL":"http://8598cebf58a1:9093"
}'
Details
A binary called dynatrace-receiver will always run on the Activegate machine, listening on the port that was configured on the extension settings.
This binary is responsible for a couple tasks:
For task number 1, there are several details involved when a new request arrives
Tasks number 2, 3 and 4 are implemented as cron jobs, running inside the same binary
The logs and the caches are stored at
TEMP_FOLDER/dynatrace-receiver
By default, on linux this is /tmp/dynatrace-receiver