Skip to content

net-mgmt/telegraf: Add header config to OpenTelemetry output and fix service_address string#5453

Open
tlaerm wants to merge 4 commits into
opnsense:masterfrom
tlaerm:telegraf-opentelemetry-header
Open

net-mgmt/telegraf: Add header config to OpenTelemetry output and fix service_address string#5453
tlaerm wants to merge 4 commits into
opnsense:masterfrom
tlaerm:telegraf-opentelemetry-header

Conversation

@tlaerm
Copy link
Copy Markdown

@tlaerm tlaerm commented May 18, 2026

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used: Qwen3.6-27B
  • Extent of AI involvement: Had it analyse the plugin code, propose, draft, discuss the changes. Make the changes.

Describe the problem

My OpenTelemetry collector is running on a https endpoint and requires a bearer token to be passed with each ingestion request. With 1.12.14 it is impossible to set this header in the config even though telegraf itself provides for it. see https://github.com/influxdata/telegraf/tree/master/plugins/outputs/opentelemetry


Describe the proposed solution

This PR adds two fields to the OpenTelemetry output config: One for the header name and one for the header value. I considered other formats, maybe even a possibility to add multiple headers but this all seemed overkill and would make the UI and input processing way more complex. This should solve the problem for the vast majority of users.
The other change is an even more trivial fix, adding quotes on the service_address field value as otherwise it does not work with https urls like https://hostname.tld/path/to/collector . The help text now also reflects the correct usage.


Related issue

None, consider it a trivial change.

@tlaerm tlaerm changed the title telegraf: Add header config to OpenTelemetry output and fix service_address string net-mgmt/telegraf: Add header config to OpenTelemetry output and fix service_address string May 18, 2026
Comment thread net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf Outdated
Comment thread net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml Outdated
Comment thread net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf Outdated
@tlaerm tlaerm requested a review from fichtner May 22, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants