Add Exception to LogRecordData#6980
Conversation
|
I made |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6980 +/- ##
==========================================
- Coverage 88.65% 88.50% -0.15%
==========================================
Files 263 263
Lines 12397 12399 +2
==========================================
- Hits 10990 10974 -16
- Misses 1407 1425 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| [OTEL1001]OpenTelemetry.Logs.LogRecordData.Exception.get -> System.Exception? | ||
| [OTEL1001]OpenTelemetry.Logs.LogRecordData.Exception.set -> void |
| /// Adds attributes representing an <see cref="Exception"/> to the list. | ||
| /// </summary> | ||
| /// <param name="exception"><see cref="Exception"/>.</param> | ||
| [Obsolete("Use LogRecordData.Exception instead. RecordException will be removed in a future version.")] |
There was a problem hiding this comment.
If code used both, would they get duplicated attributes?
| /// <summary> | ||
| /// Gets or sets the exception associated with the log. | ||
| /// </summary> | ||
| public Exception? Exception { get; set; } = null; |
There was a problem hiding this comment.
Here, and in the existing properties, the need to set to null seems redundant as the properties are already nullable.
|
Questioning whether this change is needed at this time. The Logs Bridge API spec (https://opentelemetry.io/docs/specs/otel/logs/bridge-api/#emit-a-logrecord) says the API Adding a second path (
My recommendation is to avoid this change and rely on |
|
I don't disagree, but the existence of |
|
@Kielek, as you may be aware, OpenTelemetry .NET has a few areas that slightly deviate from the current spec because the stable release happened before the spec was fully stabilized. This API is one such case. The current release is already well adopted by customers, and introducing a second API for the same purpose at this point would create unnecessary confusion for users and bridge/library authors. If we want to fully address this, I believe the right solution would be to replace the existing API rather than add another path that does the same thing. However, that would require a major version bump, and I do not think we are in a position to do that right now. My recommendation is to keep the current API as-is. Thoughts? |
e276c11 to
4d2c13c
Compare
|
If we have good reason (major bump needed) I think that we can make some differences from the otel specification, but we for sure have documentation written for all such cases. It will be great to have also issues to track such stuff. Maybe there will be good moment to release it (completely not related, but we could revisit support for netstandard2.0/2.1)? In such cases, it will be easier to go through existing issues instead of making full assessment from scratch. I would like to check this with @pellared who was working on Golang Logs stabilization. He is on Kubecon this week, so it needs to wait couple more days. |
|
@Kielek, I agree that if we keep intentional deviations from the spec, we should document and track them clearly. That said, I also want to call out that That is why I am hesitant to add a second API for the same purpose in the current release line. It increases API surface and creates potential customer confusion without closing a mandatory compliance gap. Happy to wait for your discussion with @pellared as well. |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Towards #4433
Changes
Added
Exceptionproperty toLogRecordDatastruct.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes