Skip to content

Add optional "User-Agent" header to OAuth 2.0 HTTP output plugin #11826

@rja5

Description

@rja5

Is your feature request related to a problem? Please describe.
Fluent Bit’s HTTP output supports OAuth 2.0 token retrieval, but it does not currently allow a User-Agent header to be set on the OAuth token request. We have encountered an OAuth provider that rejects token requests when User-Agent is missing or empty and are unable to retrieve a token. Adding optional User-Agent support for the OAuth request will improves compatibility while preserving backward compatibility for existing configurations.

Describe the solution you'd like
Provide the ability to add an optional User-Agent header in the oauth2.* http output plugin.
If the property is there, add the User-Agent header to the OAuth 2.0 HTTP Request.
If the property is absent, omit the User-Agent header for backwards compatibility.

Example config:

[OUTPUT]
    ...
    oauth2.user_agent test-agent
    ...

Describe alternatives you've considered
The only alternative is to fork fluent-bit and add the fix ourselves.

Additional context
We can't retrieve OAuth tokens using fluentbit HTTP from OAuth 2.0 endpoints that require a User-Agent header.

I have a working example of this change and have uploaded a git patch file.
Let me know if you'd like me to submit a branch or need any other information.

user_agent.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions