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

Tagpass with multiple output #3568

Closed
2solt opened this issue Dec 11, 2017 · 2 comments · Fixed by #3570
Closed

Tagpass with multiple output #3568

2solt opened this issue Dec 11, 2017 · 2 comments · Fixed by #3570
Labels
area/prometheus bug unexpected problem or unintended behavior
Milestone

Comments

@2solt
Copy link

2solt commented Dec 11, 2017

Bug report

Only the first first tagpass being used when using multiply outputs from the same type

Relevant telegraf.conf:

[agent]
  interval            = "1m"
  round_interval      = true
  metric_batch_size   = 1000
  metric_buffer_limit = 10000
  collection_jitter   = "0s"
  flush_interval      = "1m"
  flush_jitter        = "0s"
  precision           = ""
  debug               = true
  quiet               = false
  logfile             = ""
  omit_hostname       = true

[[inputs.http_listener]]
  service_address = "127.0.0.1:8187"

[[outputs.prometheus_client]]
  listen = ":9273"
  path = "/m"
  expiration_interval = "1m"
  [outputs.prometheus_client.tagpass]
   tag1 = ["1"]

[[outputs.prometheus_client]]
  listen = ":9274"
  path = "/m"
  expiration_interval = "1m"
  [outputs.prometheus_client.tagpass]
    tag1 = ["2"]

System info:

Telegraf v1.5.0~rc2 (git: release-1.5 fd964bd)
linux_amd64

Steps to reproduce:

  1. curl -i -XPOST http://127.0.0.1:8187/write?db=test --data-binary "test,tag1=1 value=1 $(date +%s)"
  2. curl -i -XPOST http://127.0.0.1:8187/write?db=test --data-binary "test,tag1=2 value=2 $(date +%s)"
  3. curl -s 127.0.0.1:9273/m |grep test
  4. curl -s 127.0.0.1:9274/m |grep test

Expected behavior:

curl -s 127.0.0.1:9273/m |grep test
# HELP test Telegraf collected metric
# TYPE test untyped
test{tag1="1"} 1
curl -s 127.0.0.1:9274/m |grep test
# HELP test Telegraf collected metric
# TYPE test untyped
test{tag1="2"} 2

Actual behavior:

curl -s 127.0.0.1:9273/m |grep test
# HELP test Telegraf collected metric
# TYPE test untyped
test{tag1="1"} 1
curl -s 127.0.0.1:9274/m |grep test
# HELP test Telegraf collected metric
# TYPE test untyped
test{tag1="1"} 1

Use case:

Routing metrics

@danielnelson danielnelson added area/prometheus bug unexpected problem or unintended behavior labels Dec 11, 2017
@danielnelson
Copy link
Contributor

I think this is a bug in the prometheus_client output, we must be using some global state. I tested with the file output and did not have the same issue. I also tested with Telegraf 1.4.5 which has the same issue.

@2solt
Copy link
Author

2solt commented Dec 12, 2017

Thanks for the quick response, and fix!
Tested master, all good now

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

Successfully merging a pull request may close this issue.

2 participants