Add ability to export attributes corresponding to Logrecord.EventId#4925
Conversation
…add-otlp-excluded-attributes' of https://github.com/vishweshbankwar/opentelemetry-dotnet into vibankwa/add-otlp-excluded-attributes
Codecov Report
@@ Coverage Diff @@
## main #4925 +/- ##
==========================================
- Coverage 83.65% 83.36% -0.29%
==========================================
Files 295 295
Lines 12325 12333 +8
==========================================
- Hits 10310 10282 -28
- Misses 2015 2051 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs
Outdated
Show resolved
Hide resolved
|
resolves #4404 too |
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ExperimentalOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs
Outdated
Show resolved
Hide resolved
cijothomas
left a comment
There was a problem hiding this comment.
Looks good to ship this under experimental flag, given there is no existing semantic convention for this.
Would be nice to make the changelog more self-contained to help end users navigate these changes more smoothly.
@nblumhardt Could you review as well? |
|
I think we should shy away from using
Why tie ourselves to that /cc @alanwest |
Agreed. @vishweshbankwar and I spoke about this yesterday. If we are adopting the event conventions then I think it is inappropriate to only adopt them halfway. @vishweshbankwar you were going to discuss this with other. Any updates? Any ideas of what to set The idea I shared was
I'm still not a fan of adopting them, however, as I discussed with @vishweshbankwar, I can get behind it if we embrace the spirit of applying the experimental conventions to help drive them forward based on feedback we may learn. What this looks like to me is:
|
CodeBlanch
left a comment
There was a problem hiding this comment.
LGTM
Going to try and push clarification through the spec on this: open-telemetry/semantic-conventions#372
Using instrumentation scopes could be suboptimal for libraries/the SDK generating OTLP payloads, since (as far as I understand it) "log records" nest under "scope logs" and so the SDK would need to sort/group events in order to build properly nested/non-degenerate OTLP payloads. |
+1, |
|
I really think we should shy away from trying to use the "events" spec here. It seems to be going in a much different direction. |
I agree. It's especially nasty to have something emitted with ilogger in the name from the OTLP exporter.
This was my intuition too, but I am open to trying it and continuing to solicit feedback from the community working on the event conventions. Adopting the event conventions as they are is important because the spec benefits from our participation in adopting them to drive them forward. |
This is what the spec says about InstrumentationScope and it matches closely with category definition.
This is one of the reasons I think we should not use |
Good point and I agree that CategoryName could be a good candidate for instrumentation scope name. In fact, this approach would allow our handling of CategoryName be shipped stable and we'd get rid of the This may be tricky as mentioned #4925 (comment), but it may be the right thing to do and we'll need to figure out a way to do it performantly. Circling back to address your comment with regards to event id and name.
No argument. However, this should not be conflated with what this PR is doing. This PR is attempting to adopt the event conventions. I am not aware of any users that have asked for that. For now, until someone successfully champions for something different in the spec, Also, side note, if you read open-telemetry/opentelemetry-specification#2994 carefully, you'll note that while the separate event.domain attribute may go away one suggestion is that its value is merged into |
addressing #4925 (comment) : This is a good point. However, we already do similar thing for spans and metrics [Spans are grouped by ActivitySource and Metrics are grouped by Meter]. We have a slightly optimized way of achieving this which we could further look in to improving. But the first step should be complying with stable spec. Not exporting LogRecord.CategoryName is not an option as this is also important information as per the feedback shared by users. I think we should go ahead use InstrumentationScope name for CategoryName. I am ok to try and keep that part experimental for user feedback. Regarding the Edit:
Proposal B in open-telemetry/semantic-conventions#372 is proposing |
These are questions I'm looking to you to answer. As the person recommending we use the event conventions, I'm leaning on you to describe how they're a good match for what you're trying to solve. We can't go into this ignoring the intentions of the folk who designed the conventions. We need to strive to understand their intentions and work with them to determine if we're heading down the right path. I appreciate that an issue was opened to start this discussion, but I think it's important we see it through before charging forth with whatever approach we deem convenient for our purposes. If you're finding applying the event conventions is too nebulous a challenge at this point in time. I have some other ideas for moving forward.
|
I am not recommending to use events conventions as is. If I was, I wouldn't put I see this as an opportunity to bring multiple languages in sync and not define our own conventions. It's not just .NET that needs And to add, we have not stopped for spec to ship stable things in the past so, I would like to understand the rationale behind blocking changes that depends on experimental spec and experimental feature flag. Additionally, I don't think we should be doing any workarounds. Setting experimental feature flag itself is workaround we are asking users to do on a stable library. |
|
In favor of making progress and unblocking this, I have updated the attributes to be @open-telemetry/dotnet-approvers @open-telemetry/dotnet-maintainers Please review. |
…b.com/vishweshbankwar/opentelemetry-dotnet into vibankwa/add-otlp-excluded-attributes
Logrecord.EventId and LogRecord.CategoryNameLogrecord.EventId
towards #4875
Design discussion issue #
Changes
Introduces
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTESfor exporting corresponding toLogRecord.EventId. The attributes will be exported aslogrecord.event.idandlogrecord.event.name.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes