prometheus-statsd-exporter not mapping metrics

303 Views Asked by At

I am trying to install statsd-exporter using the following helm chart:

helm install statsd-exporter prometheus-community/prometheus-statsd-exporter
https://prometheus-community.github.io/helm-charts

I have a metric mapping yaml (test-mapping.yaml) to map statsd metrics to prometheus metrics:

mappings:
  - match: "application.*.*"
    name: "application"
    match_metric_type: gauge
    labels:
        name: "$1"
        version: "$2"

I am installing statsd-exporter as follows:

helm install statsd-exporter prometheus-community/prometheus-statsd-exporter --set statsd.udpPort=9125 --set web.port=9102 --set statsd.mappingConfig="$(cat test-mapping.yaml)"

The port localhost:9102/metrics is accessible and I can see statsd metrics on it. However, when I try to write metrics via python, the new metric is not visible on the web port.

from statsd import StatsClient

st = StatsClient(host='localhost', port=9125)
st.gauge(application.hello.v1, 1)

My guess is that the issue has to do with incorrectly passing metric mappings, but I am not sure.

I have tried an alternative solution using Docker (prom/statsd-exporter) and have been successful in writing metrics to statsd and scraping from prometheus. But I want to specifically use the helm installation.

0

There are 0 best solutions below