2017-09-17 15:31:54 +00:00
|
|
|
---
|
|
|
|
layout: "guides"
|
|
|
|
page_title: "Setting up Nomad with Grafana and Prometheus Metrics"
|
|
|
|
sidebar_current: "guides-nomad-metrics"
|
|
|
|
description: |-
|
|
|
|
It is possible to collect metrics on Nomad and create dashboards with Grafana
|
|
|
|
and Prometheus. Nomad has default configurations for these, but it is
|
|
|
|
possible to build and customize these.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Setting up Nomad with Grafana and Prometheus Metrics
|
|
|
|
|
|
|
|
Often aggregating and displaying metrics in dashboards can lead to more useful
|
|
|
|
insights about a cluster. It is easy to get lost in a sea of logs!
|
|
|
|
|
|
|
|
This guide explains how to set up configuration for Prometheus and Grafana to
|
|
|
|
integrate with a Nomad cluster. While this introduces the basics to get a
|
|
|
|
dashboard up and running, Nomad exposes a wide vareity of metrics, which can be
|
|
|
|
explored via both Grafana and Prometheus.
|
|
|
|
|
2017-09-17 21:27:59 +00:00
|
|
|
## What metrics tools can be integrated with Nomad?
|
2017-09-17 15:31:54 +00:00
|
|
|
|
2017-09-17 21:27:59 +00:00
|
|
|
Nomad provides the opportunity to integrate with metrics dashboard tools such
|
|
|
|
as [Prometheus](https://prometheus.io/), [Grafana](https://grafana.com/),
|
2017-09-17 22:51:19 +00:00
|
|
|
[Graphite](https://graphiteapp.org/), [DataDog](https://www.datadoghq.com/),
|
|
|
|
and [Circonus](https://www.circonus.com ).
|
2017-09-17 15:31:54 +00:00
|
|
|
|
2017-09-17 21:27:59 +00:00
|
|
|
See Nomad's [Metrics API](/api/metrics.html.md) for more information on how
|
|
|
|
data can be exposed for other metrics tools as well.
|
2017-09-17 15:31:54 +00:00
|
|
|
|
|
|
|
## Setting up metrics
|
|
|
|
|
|
|
|
Configurations for Grafana and Prometheus can be found in the
|
2017-09-17 21:15:58 +00:00
|
|
|
[integrations](https://github.com/hashicorp/nomad/tree/master/integrations) subfolder.
|
2017-09-17 15:31:54 +00:00
|
|
|
|
|
|
|
For Prometheus, first follow Prometheus's [Getting Started
|
|
|
|
Guide](https://prometheus.io/docs/introduction/getting_started/) in order to
|
|
|
|
set up a Prometheus server. Next, use the (Nomad Prometheus
|
2017-09-17 21:15:58 +00:00
|
|
|
Configuration)[https://github.com/hashicorp/tree/master/noamd/integrations/prometheus/prometheus.yml]
|
2017-09-17 15:31:54 +00:00
|
|
|
in order to configure Prometheus to talk to a Consul agent to fetch information
|
|
|
|
about the Nomad cluster. See the
|
2017-09-17 21:15:58 +00:00
|
|
|
[README](https://github.com/hashicorp/tree/master/nomad/integrations/prometheus/README.md)
|
2017-09-17 15:31:54 +00:00
|
|
|
for more information.
|
|
|
|
|
|
|
|
For Grafana, follow Grafana's [Getting
|
|
|
|
Started](http://docs.grafana.org/guides/getting_started/) guide to set up a
|
|
|
|
running Grafana instance. Then, import the sample [Nomad
|
2017-09-17 21:15:58 +00:00
|
|
|
Dashboard](https://github.com/hashicorp/nomad/tree/master/integrations/grafana/sample_dashboard.json)
|
2017-09-17 15:31:54 +00:00
|
|
|
for an example Grafana dashboard. This dashboard requires a Prometheus data
|
|
|
|
source to be configured, see the
|
2017-09-17 21:15:58 +00:00
|
|
|
[README.md](https://github.com/hashicorp/nomad/tree/master/integrations/grafana/README.md)
|
2017-09-17 15:31:54 +00:00
|
|
|
for more information.
|
|
|
|
|
|
|
|
## Tagged Metrics
|
|
|
|
|
|
|
|
As of version 0.7, Nomad will start emitting metrics in a tagged format. Each
|
|
|
|
metrics can support more than one tag, meaning that it is possible to do a
|
|
|
|
match over metrics for datapoints such as a particular datacenter, and return
|
|
|
|
all metrics with this tag.
|
|
|
|
|
|
|
|
See how [Grafana](http://docs.grafana.org/v3.1/reference/templating/) enables
|
|
|
|
tagged metrics easily.
|
|
|
|
|