Prometheus metrics scraping in Nomad

559 views
Skip to first unread message

Jerry Peng

unread,
Apr 3, 2018, 8:10:37 PM4/3/18
to Nomad
Hi all,

If I want prometheus to scrap metrics from jobs in Nomad is there support for that?  Similar to what is supported in Kubernetes:

https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L248

What is the recommended way for getting job specific metrics into prometheus?

Best,

Jerry

Lowe Schmidt

unread,
Apr 4, 2018, 6:25:48 AM4/4/18
to Jerry Peng, Nomad

--
Lowe Schmidt | +46 723 867 157

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/a65afd10-ca6c-4eb7-929b-1085609b3bc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lowe Schmidt

unread,
Apr 4, 2018, 6:27:04 AM4/4/18
to Jerry Peng, Nomad
Oh, sorry. I think I misunderstood your question. 



--
Lowe Schmidt | +46 723 867 157

Laurent Commarieu

unread,
Apr 5, 2018, 1:25:33 AM4/5/18
to Nomad
Hi,

Nomad jobs are registered in consul so you can use consul_sd in Prometheus to discover ip/port of your services.
Then with relabelling in prometheus you can discard or keep some services based on tag (added in nomad job) or up or name.

That's how we do it, if a service start on nomad with a tag named "metrics=true" it's automatically scraped by prometheus.

Regards,

Laurent

Reply all
Reply to author
Forward
0 new messages