Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric rename in prometheus input and multiple prometheus outputs #4220

Closed
zagy opened this issue Jun 1, 2018 · 3 comments
Closed

Metric rename in prometheus input and multiple prometheus outputs #4220

zagy opened this issue Jun 1, 2018 · 3 comments
Labels
area/prometheus bug unexpected problem or unintended behavior

Comments

@zagy
Copy link

zagy commented Jun 1, 2018

In #2950 the renaming was generally fixed (so that haproxy_up doesn't become haproxy_up_gauge). When there is more than one Prometheus output, only the last yields the desired result.

Relevant telegraf.conf:

[inputs]

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

[outputs]

[[outputs.prometheus_client]]
listen = "172.22.50.75:2000"

[[outputs.prometheus_client]]
listen = "172.22.50.75:2001"

Note: multiple outputs on different ports is pretty pointless. The actual use case is IPv4+IPv6 on a certain interface.

System info:

  • Telegraf 1.5.3

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:

First output:

$ curl http://172.22.50.75:2000/metrics -s | grep haproxy_up
# HELP haproxy_up_gauge Telegraf collected metric
# TYPE haproxy_up_gauge untyped
haproxy_up_gauge{host="apo00",location="rzob",platform="nixos",resource_group="apo",url="http://localhost:9127/metrics"} 1

That was wrong. Next output is better:

$  curl http://172.22.50.75:2001/metrics -s | grep haproxy_up
# HELP haproxy_up Telegraf collected metric
# TYPE haproxy_up gauge
haproxy_up{host="apo00",location="rzob",platform="nixos",resource_group="apo",url="http://localhost:9127/metrics"} 1

Expected behavior:

  • No rename of metric
  • Keep type

Actual behavior:

  • Metric is being renamed to *_ (e.g. haproxy_up becomes haproxy_up_gauge)
  • Type becomes untyped
@danielnelson danielnelson added bug unexpected problem or unintended behavior area/prometheus labels Jun 1, 2018
@danielnelson
Copy link
Contributor

Thanks for the report. I'm not sure the cause, but this appears to be fixed in the latest release. Since I am no longer providing updates to the 1.5 line you will need to update.

@zagy
Copy link
Author

zagy commented Jun 1, 2018

No problem with updating. Looking through the changes didn't reveal a fix for me, but if it's fixed that's great. Sorry for the noise.

@danielnelson
Copy link
Contributor

No problem, yeah I'm not sure what fixed it either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants