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

http_headers doesn't work on prometheus input #12364

Closed
brianzer0 opened this issue Dec 8, 2022 · 1 comment
Closed

http_headers doesn't work on prometheus input #12364

brianzer0 opened this issue Dec 8, 2022 · 1 comment
Labels
bug unexpected problem or unintended behavior

Comments

@brianzer0
Copy link

Relevant telegraf.conf

[[inputs.prometheus]]
  urls = ["https://127.0.0.1:9644/metrics"]

  [inputs.prometheus.http_headers]
     Connection = "keep-alive"

Logs from Telegraf

Dec  8 22:25:57 x telegraf[869809]: 2022-12-08T22:25:57Z E! [telegraf] Error running agent: error loading config file /etc/telegraf/telegraf.d/input_.conf: plugin inputs.prometheus: line 1: configuration specified the fields ["http_headers"], but they weren't used

System info

telegraf 1.24.24, rocky linux 9

Docker

No response

Steps to reproduce

  1. Try to use "http_headers" config on prometheus input

Expected behavior

Should be able to set http headers for plugin. Also doc seems to be wrong as it tells you to set "headers" which also does not work

Actual behavior

Cant set headers for prometheus plugin

Additional info

Not sure how the unused field tracking really works, but can we just add "http_headers" to the exclude case statement in config.go?

@brianzer0 brianzer0 added the bug unexpected problem or unintended behavior label Dec 8, 2022
@powersj
Copy link
Contributor

powersj commented Dec 8, 2022

Headers were only recently added here d4eda21

telegraf 1.24.24

Unless you are running a nightly build this wont work

edit: 1.25.0 will go out next week with this feature.

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

No branches or pull requests

2 participants