grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
990 stars 102 forks source link

Multi tenant aware grafana agent #276

Open martinjaegerdk opened 5 months ago

martinjaegerdk commented 5 months ago

Request

As far as i can tell, the agents support for multi tenancy is limited to static configuration. Either through adding a custom HTTP header for remote write configurations, or setting tenant_id attribute where that is supported.

I have a few use cases, where i would like for the grafana-agent to support dynamic multi tenancy. E.g. setting tenant_id/HTTP Header based on a label value.

Use case

Having a common agent that can support scraping data for multiple tenants.

github-actions[bot] commented 4 months ago

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it. If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue. The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity. Thank you for your contributions!

romanfurst commented 3 weeks ago

HI @martinjaegerdk , I haven't tried it myself yet, but it seems like setting label __tenant_id__ could do the job. Or am I mistaken?

look here

martinjaegerdk commented 3 weeks ago

@romanfurst Nice find. It certainly looks that way 💪 I will test this out when i have a use case. The last time i set it up using a separate agent, which is working fine obviously, so not gonna touch that.