Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
statsd-export.consul.j2
consul.*.runtime.*
name="consul_runtime"
type="$2"
host="{{ inventory_hostname }}"
consul.runtime.total_gc_pause_ns
name="consul_runtime_total_gc_pause_ns"
type="$2"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7.$8"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7.$8.$9"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7.$8.$9.$10"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7.$8.$9.$10.$11"
host="{{ inventory_hostname }}"
consul.consul.health.service.query-tag.*.*.*.*.*.*.*.*.*.*.*.*
name="consul_health_service_query_tag"
query="$1.$2.$3.$4.$5.$6.$7.$8.$9.$10.$11.$12"
host="{{ inventory_hostname }}"
consul.consul.fsm.persist
name="consul_fsm_persist"
host="{{ inventory_hostname }}"
consul.consul.catalog.deregister
name="consul_catalog_deregister"
host="{{ inventory_hostname }}"
consul.consul.http.PUT.v1.agent.service_register
name="consul_http_PUT_v1_agent_service_register"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.kv.*
name="consul_http_GET_v1_kv"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.internal.ui.nodes
name="consul_http_GET_v1_internal_ui_nodes"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.internal.ui.node.*
name="consul_http_GET_v1_internal_ui_node"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.health.service.*
name="consul_http_GET_v1_health_service"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.catalog.datacenters
name="consul_http_GET_v1_catalog_datacenters"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.acl.list
name="consul_http_GET_v1_acl_list"
host="{{ inventory_hostname }}"
consul.consul.dns.domain_query.*.*.*.*.*
name="consul_dns_domain_query"
query="$1.$2.$3.$4.$5"
host="{{ inventory_hostname }}"
consul.consul.health.service.not-found.*
name="consul_health_service_not_found"
host="{{ inventory_hostname }}"
query="$1"
consul.consul.health.service.query.*
name="consul_health_service_query"
query="$1"
host="{{ inventory_hostname }}"
consul.*.memberlist.health.score
name="consul_memberlist_health_score"
host="{{ inventory_hostname }}"
consul.serf.queue.*
name="consul_serf_events"
type="$1"
host="{{ inventory_hostname }}"
consul.serf.snapshot.appendLine
name="consul_serf_snapshot_appendLine"
type="$1"
host="{{ inventory_hostname }}"
consul.serf.coordinate.adjustment-ms
name="consul_serf_coordinate_adjustment_ms"
host="{{ inventory_hostname }}"
consul.consul.rpc.query
name="consul_rpc_query"
host="{{ inventory_hostname }}"
consul.*.consul.session_ttl.active
name="consul_session_ttl_active"
host="{{ inventory_hostname }}"
consul.raft.rpc.*
name="consul_raft_rpc"
type="$1"
host="{{ inventory_hostname }}"
consul.raft.rpc.appendEntries.storeLogs
name="consul_raft_rpc_appendEntries_storeLogs"
type="$1"
host="{{ inventory_hostname }}"
consul.raft.fsm.apply
name="consul_raft_fsm_apply"
host="{{ inventory_hostname }}"
consul.raft.leader.lastContact
name="consul_raft_leader_lastcontact"
host="{{ inventory_hostname }}"
consul.raft.leader.dispatchLog
name="consul_raft_leader_dispatchLog"
host="{{ inventory_hostname }}"
consul.raft.commitTime
name="consul_raft_commitTime"
host="{{ inventory_hostname }}"
consul.raft.replication.appendEntries.logs.*.*.*.*
name="consul_raft_replication_appendEntries_logs"
host="{{ inventory_hostname }}"
query="${1}.${2}.${3}.${4}"
consul.raft.replication.appendEntries.rpc.*.*.*.*
name="consul_raft_replication_appendEntries_rpc"
host="{{ inventory_hostname }}"
query="${1}.${2}.${3}.${4}"
consul.raft.replication.heartbeat.*.*.*.*
name="consul_raft_replication_heartbeat"
host="{{ inventory_hostname }}"
query="${1}.${2}.${3}.${4}"
consul.consul.rpc.request
name="consul_rpc_requests"
host="{{ inventory_hostname }}"
consul.consul.rpc.accept_conn
name="consul_rpc_accept_conn"
host="{{ inventory_hostname }}"
consul.memberlist.udp.*
name="consul_memberlist_udp"
type="$1"
host="{{ inventory_hostname }}"
consul.memberlist.tcp.*
name="consul_memberlist_tcp"
type="$1"
host="{{ inventory_hostname }}"
consul.memberlist.gossip
name="consul_memberlist_gossep"
host="{{ inventory_hostname }}"
consul.memberlist.probeNode
name="consul_memberlist_probenode"
host="{{ inventory_hostname }}"
consul.memberlist.pushPullNode
name="consul_memberlist_pushpullnode"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.catalog.datacenters
name="consul_http_GET_catalog_datacenters"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.coordinate.nodes
name="consul_http_GET_coordinate_nodes"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.health.service.*
name="consul_http_GET_health_service"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.internal.ui.nodes.*
name="consul_http_GET_internal_ui_nodes"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.internal.ui.services
name="consul_http_GET_internal_ui_services"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.session.node.*
name="consul_http_GET_session_node"
host="{{ inventory_hostname }}"
consul.consul.http.GET.v1.kv.*.*.*
name="consul_http_GET_kv"
host="{{ inventory_hostname }}"
consul.consul.leader.barrier
name="consul_leader_barrier"
host="{{ inventory_hostname }}"
consul.consul.leader.reconcileMember
name="consul_leader_reconcileMember"
host="{{ inventory_hostname }}"
consul.consul.leader.reconcile
name="consul_leader_reconcile"
host="{{ inventory_hostname }}"
consul.consul.fsm.coordinate.batch-update
name="consul_fsm_coordinate_batch_update"
host="{{ inventory_hostname }}"
consul.consul.fsm.register
name="consul_fsm_register"
host="{{ inventory_hostname }}"
consul.consul.fsm.deregister
name="consul_fsm_deregister"
host="{{ inventory_hostname }}"
consul.consul.catalog.register
name="consul_catalog_register"
host="{{ inventory_hostname }}"
consul.consul.catalog.deregister
name="consul_catalog_deregister"
host="{{ inventory_hostname }}"
consul.consul.fsm.tombstone.reap
name="consul_fsm_tombstone_reap"
host="{{ inventory_hostname }}"
consul.consul.leader.reapTombstones
name="consul_leader_reapTombstones"
host="{{ inventory_hostname }}"
@matthiasr

This comment has been minimized.

Copy link

matthiasr commented Aug 27, 2018

A heads up from the statsd exporter maintainer: the configuration in this gist no longer works out of the box. The exporter now expects a new YAML-based config format; you can refer to the release notes for conversion instructions:

https://github.com/prometheus/statsd_exporter/blob/master/CHANGELOG.md#v050--2017-11-16

Alternatively, use the consul telemetry exporter.

@dhiren051

This comment has been minimized.

Copy link

dhiren051 commented Jul 25, 2019

I tried to follow your great article: https://werner-dijkerman.nl/2017/05/27/monitoring-consul-with-statsd-exporter-and-prometheus/

will this work with consul version 0.9.3 ?

I converted this config to yml : https://gist.github.com/dhiren051/b87f15ec02429afeef2e4bdd1a5365d8

but getting these warnings upon executing: ./statsd_exporter --statsd.mapping-config=statsd-exporter.yml
time="2019-07-23T16:28:58-07:00" level=info msg="Accepting StatsD Traffic: UDP :9125, TCP :9125, Unixgram " source="main.go:158"
time="2019-07-23T16:28:58-07:00" level=info msg="Accepting Prometheus Requests on :9102" source="main.go:159"
time="2019-07-25T11:44:36-07:00" level=info msg="Starting StatsD -> Prometheus Exporter (version=0.12.1, branch=HEAD, revision=6635ea71e80f92b20d9863e01a2c6bc9339dbd64)" source="main.go:156"
time="2019-07-25T11:44:36-07:00" level=info msg="Build context (go=go1.12.6, user=root@af5b518ef75a, date=20190708-08:56:16)" source="main.go:157"
time="2019-07-25T11:44:36-07:00" level=info msg="Accepting StatsD Traffic: UDP :9125, TCP :9125, Unixgram " source="main.go:158"
time="2019-07-25T11:44:36-07:00" level=info msg="Accepting Prometheus Requests on :9102" source="main.go:159"
time="2019-07-25T11:44:36-07:00" level=warning msg="backtracking required because of match "consul..memberlist.health.score", matching performance may be degraded" source="fsm.go:313"
time="2019-07-25T11:44:36-07:00" level=warning msg="backtracking required because of match "consul.
.consul.session_ttl.active", matching performance may be degraded" source="fsm.go:313"
time="2019-07-25T11:44:36-07:00" level=warning msg="backtracking required because of match "consul..runtime.", matching performance may be degraded" source="fsm.go:313"
time="2019-07-25T11:44:36-07:00" level=warning msg="match "consul.consul.http.GET.v1.health.service." is a super set of match "consul.consul.http.GET.v1.health.service." but in a lower order, the first will never be matched" source="fsm.go:294"

Also, as per given variable at dashboard - https://grafana.com/grafana/dashboards/2351 - I am not able to see metric of "consul_memberlist_gossep_sum"

Could you please help me here in setting up statsd_exporter in promotheus to monitor consul cluster servers.

@sivanag1974

This comment has been minimized.

Copy link

sivanag1974 commented Oct 9, 2019

I am also getting the same message as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.