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

fix(outputs.influxdb_v2): Allow overriding auth and agent headers #16383

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

DStrand1
Copy link
Member

@DStrand1 DStrand1 commented Jan 8, 2025

Summary

In #16147, the http header code for the http request was refactored, which led to a changing of the order of header application.

In v1.32.2:

  1. "Hard-coded" headers (Authorization, User-Agent) were added to the headers
  2. User-specified headers (config http_headers) were added, overwriting the "hard-coded" headers if manually specified

In v1.32.3+:

  1. User-specified headers (config http_headers) were added to the headers
  2. "Hard-coded" headers (Authorization, User-Agent) were added, overwriting the user-specified headers

In short, if an Authorization or User-Agent header was specified via the configuration http_headers in v1.32.3+, it would be overwritten by the default user agent and the secret store token. This PR reverts this change to be like v1.32.2 and older.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16380

@DStrand1 DStrand1 requested a review from srebhan January 8, 2025 16:59
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jan 8, 2025

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added area/influxdb fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Jan 8, 2025
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @DStrand1!

@srebhan srebhan changed the title fix(outputs.influxdb_v2): Fix http auth/agent header fix(outputs.influxdb_v2): Allow overriding auth and agent headers Jan 9, 2025
@srebhan srebhan merged commit 8645ac0 into influxdata:master Jan 9, 2025
28 of 29 checks passed
@github-actions github-actions bot added this to the v1.33.1 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf v1.33 doesn't write to InfluxDB3 using influxdb_v2 output plugin, whereas Telegraf v1.32 does
2 participants