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

otel-appender-tracing can suppress other tracing layers #1682

Open
cijothomas opened this issue Apr 26, 2024 · 4 comments
Open

otel-appender-tracing can suppress other tracing layers #1682

cijothomas opened this issue Apr 26, 2024 · 4 comments
Assignees
Labels
A-log Area: Issues related to logs priority:p1 Critical issues and bugs. Highest priority.

Comments

@cijothomas
Copy link
Member

With logs_level_enabled feature, the appender-tracing returns false on event_enabled if it has no interest in the event. But this causes other layers, like a fmt layer to also miss the events. Lack of interest for otel layer should not influence other layers.

I believe the solution should be to rewrite the logs_level_enabled to use https://docs.rs/tracing-subscriber/latest/tracing_subscriber/layer/index.html#per-layer-filtering

@cijothomas cijothomas added priority:p1 Critical issues and bugs. Highest priority. A-log Area: Issues related to logs labels Apr 26, 2024
@lalitb
Copy link
Member

lalitb commented Apr 26, 2024

Haven't tested this, but I believe the effect of event_enabled returning false is localized to the layer where it is implemented, which in this case is OpenTelemetryTracingBridge. It should only effect the processing of event in this layer. Other layers in the stack might still process it if their implementations of event_enabled return true or if they do not provide an event_enabled implementation at all.

@cijothomas
Copy link
Member Author

I believe the effect of event_enabled returning false is localized to the layer where it is implemented

Well, that is not the case! Any layer returning false would affect entire layers! (or the first layer that returns false, would cause the rest of the layers to be bypassed completely)

@lalitb
Copy link
Member

lalitb commented Apr 26, 2024

True, did a quick test by modifying the example by adding a console-layer after otel-bridge layer, and forcing event_enabled to be false for otel-bridge - https://github.com/open-telemetry/opentelemetry-rust/compare/main...lalitb:test-multiple-layers?expand=1. The console-layer is not processed.
Will look into this. Thanks for raising the issue.

@stormshield-fabs
Copy link

From the Layer::event_enabled documentation:

Layers which do not wish to be notified about certain events but do not wish to globally disable them should ignore those events in their on_event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-log Area: Issues related to logs priority:p1 Critical issues and bugs. Highest priority.
Projects
None yet
Development

No branches or pull requests

3 participants