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

OpenTelemetry Plugins should have a way to modify Resource and Scope #8206

Closed
braydonk opened this issue Nov 20, 2023 · 10 comments
Closed

OpenTelemetry Plugins should have a way to modify Resource and Scope #8206

braydonk opened this issue Nov 20, 2023 · 10 comments
Labels
opentelemetry Fluent Bit + OpenTelemetry integration

Comments

@braydonk
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Resource Attributes in OTLP are used to identify logs with a particular resource, making them very important for an OTLP exporter to be able to modify. Today, there is no way to add Resource Attributes, but this is very common in OTLP pipelines and is crucial for making OTLP useful for more cases in Fluent Bit.
Scope is not quite as crucial as Resource, but it would still make sense to allow access to that too.

Describe the solution you'd like
Something similar to add_label could work. add_resource_attribute perhaps. I think that would still be too limiting though, and the best possible solution is allowing a way to operate on resource in all the standard field modification operations.

With Scope, it would make sense to actually instrument a Fluent Bit scope, so that downstream consumers will be able to tell that the data was produced by a Fluent Bit agent. Other than that, the same solution as Resource should be available for Scope too.

Describe alternatives you've considered

N/A

Additional context

To make Fluent Bit as useful as possible for OTLP pipelines, it really should be able to operate on Resource and Scope just like the OpenTelemetry Collector can. See also #8205, which is actually a bug particular to logs that definitely makes Fluent Bit hard to use for this case.

@braydonk braydonk changed the title OpenTelemetry Plugins should have a way to add Resource and Scope attributes OpenTelemetry Plugins should have a way to modify Resource and Scope Nov 20, 2023
@lecaros lecaros added the opentelemetry Fluent Bit + OpenTelemetry integration label Dec 22, 2023
@liji-canva
Copy link

Totally agree with this feature request. Do we any plan on this?

The current workaround is to setup an intermediate opentelemetry collector between fluent-bit and the final opentelemetry collector and configure the resource processor on this intermediate opentelemetry collector to add resource attributes. This obviously makes things complicated.

@SHaaD94
Copy link

SHaaD94 commented Jan 10, 2024

What about altering syntax of add_label to be following for out:opentelemetry?

add_label            label_name label_value resource|scope ?

Would be happy to raise a PR if this will get approved

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Apr 11, 2024
@braydonk braydonk removed the Stale label Apr 11, 2024
@braydonk
Copy link
Contributor Author

This is still relevant.

@shaohme
Copy link
Contributor

shaohme commented May 7, 2024

It is relevant

There is also a use case in which fluent-bit collects metrics from all kinda source on a "device" with a unique ID. Instead of all programs separately declares the same resource attribute, like "service.instance.id", Fluent-Bit could add this attribute value to all Spans/Log/Metrics it collects before it outputs them to a remote OpenTelemetry Collector.

@edsiper edsiper added this to the Fluent Bit v3.1.0 milestone Jun 4, 2024
@edsiper
Copy link
Member

edsiper commented Jun 21, 2024

FYI: Opentelemetry Logs resource and scope handling is done through #8989

@edsiper
Copy link
Member

edsiper commented Jun 24, 2024

#8989 merged

@edsiper edsiper closed this as completed Jun 25, 2024
@shaohme
Copy link
Contributor

shaohme commented Jun 25, 2024

#8989 merged

Nice to see it implemented for logs 👍 but shouldn't we close the issue when support for metrics and spans have been implemented too?

@Brodiemm
Copy link

Brodiemm commented Aug 6, 2024

Yes, appreciate the work on logs, is there an open ticket for metrics and traces resource attribute modification support?

@nortenorte
Copy link

For metrics and traces we have opened #9842.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opentelemetry Fluent Bit + OpenTelemetry integration
Projects
None yet
Development

No branches or pull requests

8 participants