Skip to content

Type loss and metric rename in prometheus input → prometheus output #2950

@zagy

Description

@zagy

Bug report

Loading the data with telegraf Prometheus input and exporting it with the prometheus output (e.g. haproxy-exporter --[prometheus protocol]--telegraf---[prometheus protocol]---…) yields

  • Metric is being renamed to *_<type> (e.g. haproxy_up becomes haproxy_up_gauge)
  • Type becomes untyped

Relevant telegraf.conf:

[inputs.prometheus]
urls = ["http://localhost:9127/metrics"]

[outputs.prometheus_client]
listen = "172.22.49.216:9126"

System info:

Tested in

  • 1.2.1
  • 1.3.0

Steps to reproduce:

  1. Setup https://github.com/prometheus/haproxy_exporter
  2. Point telegraf to haproxy_export (prometheus input)
  3. Setup telegraf output prometheus_client
  4. See that metrics are renamed after they come out of telegraf.

Expected behavior:

  • No rename of metric
  • Keep type

Actual behavior:

  • Metric is being renamed to *_<type> (e.g. haproxy_up becomes haproxy_up_gauge)
  • Type becomes untyped

haproxy exporter gives:

# HELP haproxy_up Was the last scrape of haproxy successful.
# TYPE haproxy_up gauge
haproxy_up 1

Telegraf exports:

# HELP haproxy_up_gauge Telegraf collected metric
# TYPE haproxy_up_gauge untyped
haproxy_up_gauge{host="hostname", url="http://localhost:9127/metrics"} 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/prometheusbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions