14 Nov 2024 07:31 AM
Hi all,
I have an application orchestrated in Docker Swarm. My application containers expose custom Prometheus metrics, which I currently scrape using a Prometheus container and visualize in Grafana.
I'm looking to integrate these metrics into Dynatrace, but I prefer not to send them directly to the public metrics ingestion endpoint. Ideally, I'd like to leverage the Dynatrace OneAgent to collect these metrics.
Could anyone advise on the best approach for achieving this please?
Is it possible for a Dynatrace extension to query my existing Prometheus container and forward the metrics to the OneAgent?
I'm open to other more solutions if available
Thanks in advance
Ranj
14 Nov 2024 07:41 AM
Hi @ranjpurewal ,
kindly check this link for how to integrate with Prometheus and collecting metrics
https://docs.dynatrace.com/docs/shortlink/monitor-prometheus-metrics
BR,
Mostafa Hussein.
14 Nov 2024 08:02 AM
Thanks for the link, but seems like this is around kubernetes and Pods etc i.e using annotations etc
My application is running as docker services/containers on a docker swarm. With Prometheus also running as a docker container
Is it possible in my setup to export Prometheus metrics to Dynatrace?
Thanks in advance
Ranj
14 Nov 2024 02:23 PM
Hi @ranjpurewal ,
Yes it's possible, I've created 2 basic containers for prometheus with URL localhost:9090 and oneagent, see the following link:
https://docs.dynatrace.com/docs/shortlink/oneagent-docker
finally I got all my containers is monitored now as the following figure
then created basic v2 extension following this guides
https://docs.dynatrace.com/docs/shortlink/prometheus-manage
https://developer.dynatrace.com/develop/dynatrace-extensions-vscode/getting-started/
once the prometheus extension deployed I started to make a configuration and the prometheus url `localhost:9090` discovered automatically in addition you've the option to choose you want to monitor it locally or remotely, monitor locally is feasible in case you're monitoring your prometheus container with OneAgent as mentioned in the documentation i've mentioned in my first reply
in the following figure you can set the local url of your prometheus metrics
Thanks,
Mostafa Hussein.
14 Nov 2024 02:31 PM
Thanks @MostafaHussein
Will give it a go
14 Nov 2024 02:32 PM
let me know when you get it successful!