Consul-helm: Metrics in prometheus format

Created on 10 Jul 2020  路  3Comments  路  Source: hashicorp/consul-helm

When i tried to get metrics in prometheus format /v1/agent/metrics?format=prometheus i got Prometheus is not enabled since its retention time is not positive.

I found that consul has https://www.consul.io/docs/agent/options.html#telemetry-prometheus_retention_time
How i can set it using helm chart?

question themtelemetry

All 3 comments

Hi, you can set this in the extraConfig section of the helm chart for servers and clients:

client:
  extraConfig: |
    {"telemetry": {"prometheus_retention_time": "<your value>"}}
server:
  extraConfig: |
    {"telemetry": {"prometheus_retention_time": "<your value>"}}

@lkysow Thanks, that works!
Any plans to add prometheus operator ServiceMonitor support? https://github.com/hashicorp/consul-helm/issues/494

Hey Sergey, we do have it on our roadmap to look at documenting how to expose metrics better and so I think we'd want to look at servicemonitor as well during that time.

I'm going to close this specific issue because it looks like your problem was solved and we've already got that other ticket tracking ServiceMonitor support.

Was this page helpful?
0 / 5 - 0 ratings