Comments (6)
My understanding was that the OTEL API was just a wrapper around Activity
but with the correct names. Is that incorrect?
from serilog.enrichers.span.
Looks like that's not not the case. There's not much documentation around it but:
open-telemetry/opentelemetry-dotnet#1842
and
The recommended way to add Baggage is to use the Baggage.SetBaggage() API. OpenTelemetry users should not use the Activity.AddBaggage method.
I think the idea here is that in OTEL API Baggage isn't tied to an Activity (Span) context; it's a separate/standalone thing with its own propagator and whatnot.
It's all pretty confusing, because OTEL Baggage is propagated using standard W3C headers (as long you're using the OTEL propagators). And a receiving app using ASP.NET Core's built in diagnostics (without OTEL) will see those headers and set them on Activity.Baggage, where this Serilog Enricher will find them.
But the limitation there is that OTEL Baggage isn't copied into Activity.Baggage until that propagation has occurred. So for an app that does Baggage.SetBaggage()
, this Serilog Enricher won't see that data and include it in the logs.
Maybe this is an issue for OTEL .NET to address -- maybe Baggage.SetBaggage()
should be copying values into Activity.Baggage()
But it's really hard to know what's most correct here...
from serilog.enrichers.span.
The key lines in the second link:
It is important to note that Baggage is not automatically attached to any telemetry. User can explicitly read Baggage and use it to enrich metrics, logs and traces. An example of doing this for traces is shown here.
It sounds like you have to copy baggage manually?
from serilog.enrichers.span.
I think the idea there is that OTEL telemetry data (Traces, Metrics, Logs) is not automatically enriched with Baggage. If you want it, you have to be explicit.
This also underscores how, in the OTEL specification, Baggage is a standalone thing and not tied to Traces/Activities, which is probably why OTEL .NET is trying to move away from Activity.Baggage.
Since this project is a Serilog Enricher, that's why I raised the issue here. But I realize Serilog != OTEL Logging, and I don't know what it'd look like to bring those things together. For now, I can certainly add a tiny OtelBaggageEnricher to Serilog to solve this problem.
from serilog.enrichers.span.
This is certainly confusing. I'm not sure this project should do anything about this though. We'd also need to add a reference to the OTEL package if we decide to. Should we close for now?
from serilog.enrichers.span.
Confusing indeed. Especially when OTEL acts as if Baggage is a separate thing from Trace, but recommends using "W3C format for distributed trace" to propagate it. But these things are in various levels of draft/experimental/beta, so probably premature to decide how Serilog (and this Enricher) should participate in that world, and maybe another package someday to avoid the extra dependency.
I'll go ahead and close. Hope this issue / bread crumb helps someone else!
from serilog.enrichers.span.
Related Issues (20)
- Allow to select names for log event properties HOT 2
- Target netstandard2.0 HOT 3
- Empty attributes if no tags used
- Make ActivityExtensions public HOT 2
- ParentSpanId instead of ParentId HOT 3
- Add option to log TraceState HOT 3
- FileNotFoundException for System.Diagnostics.DiagnosticSource with version 3.0.0 HOT 1
- FileNotFoundException for System.Diagnostics.DiagnosticSource with version 3.0.0 #237 HOT 2
- Support transforming trace values HOT 3
- Add TraceFlags Enricher
- Allow setting custom values for SpanId, TraceId and ParentId HOT 9
- DD tracing/span
- ActivityEnricher uses a cached LogEventProperty regardless of the current SpanLogEventPropertiesNames
- Targetting net standard HOT 1
- This Repo is Now Deprecated HOT 5
- Provide example of setting SpanOptions in appsettings.json HOT 2
- Allow to have the operation name from the Activity in span HOT 2
- Dependency Dashboard
- Support framework 4.7 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serilog.enrichers.span.