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

Support for headers in Loki Sink Configuration #21332

Open
LinTechSo opened this issue Sep 22, 2024 · 1 comment
Open

Support for headers in Loki Sink Configuration #21332

LinTechSo opened this issue Sep 22, 2024 · 1 comment
Labels
sink: loki Anything `loki` sink related type: feature A value-adding code addition that introduce new functionality.

Comments

@LinTechSo
Copy link

LinTechSo commented Sep 22, 2024

Hi

In the current Loki sink configuration in Vector (https://vector.dev/docs/reference/configuration/sinks/loki/), there is no support for specifying a tenant_id_key or custom header fields.

To make Vector more flexible for users running multi-tenant Loki clusters or who need to pass custom headers for authentication/other purposes, I propose adding these two features:

`tenant_id_key`: A configuration option to specify a key in the log event that will be used to dynamically assign the tenant ID key.
    This will enable multi-tenant support in a more flexible way by allowing different tenant IDs to be derived from the log event rather than being statically configured.
`header`:  add extra custom HTTP headers when sending logs to Loki.
    This feature would allow additional headers for specific use cases such as API tokens, custom authentication mechanisms, etc.

I saw a similar configuration for FluentBit: https://docs.fluentbit.io/manual/pipeline/outputs/loki

Use Cases

No response

Attempted Solutions

No response

Proposal

No response

References

No response

Version

0.40.0

@LinTechSo LinTechSo added the type: feature A value-adding code addition that introduce new functionality. label Sep 22, 2024
@jszwedko jszwedko added the sink: loki Anything `loki` sink related label Sep 23, 2024
@jszwedko
Copy link
Member

Hey!

tenant_id is already dynamically configurable via templating: https://vector.dev/docs/reference/configuration/sinks/loki/#tenant_id

For example:

tenant_id: "{{ .some_field }} "

Will use some_field as the tenant id.

Adding in the ability to configure arbitrary HTTP headers seems useful though.

@jszwedko jszwedko changed the title Support for tenant_id_key and header in Loki Sink Configuration Support for headers in Loki Sink Configuration Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: loki Anything `loki` sink related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants