-
Notifications
You must be signed in to change notification settings - Fork 862
OTLP Exporter: Conditionally compile experimental log features #4762
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
Changes from 5 commits
5c3188c
96a280b
0a5669d
2dea303
5b00c21
6dfcefb
10374f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,13 @@ | |
|
|
||
| using System.Runtime.CompilerServices; | ||
| using Google.Protobuf; | ||
| #if EXPOSE_EXPERIMENTAL_FEATURES | ||
| using OpenTelemetry.Internal; | ||
| #endif | ||
| using OpenTelemetry.Logs; | ||
| #if EXPOSE_EXPERIMENTAL_FEATURES | ||
| using OpenTelemetry.Trace; | ||
| #endif | ||
| using OtlpCollector = OpenTelemetry.Proto.Collector.Logs.V1; | ||
| using OtlpCommon = OpenTelemetry.Proto.Common.V1; | ||
| using OtlpLogs = OpenTelemetry.Proto.Logs.V1; | ||
|
|
@@ -79,7 +83,7 @@ internal static OtlpLogs.LogRecord ToOtlpLog(this LogRecord logRecord, SdkLimitO | |
|
|
||
| var attributeValueLengthLimit = sdkLimitOptions.AttributeValueLengthLimit; | ||
| var attributeCountLimit = sdkLimitOptions.AttributeCountLimit ?? int.MaxValue; | ||
|
|
||
| #if EXPOSE_EXPERIMENTAL_FEATURES | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we still going to rename the EventId keys? I think we should.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PS: Probably worth mentioning this in CHANGELOG.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See conversation here #4762 (comment)
Yes, please hold on merging this. I haven't submitted a changelog entry yet because I'm working on a method to document our experimental features somewhat centrally.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @CodeBlanch @utpilla @vishweshbankwar @Kielek Take another look at this PR. Besides updating the changelog, I reorganized it a bit to propose a slightly different pattern documenting experimental features not only in the changelog but also in the README. This way the documentation of our experimental features doesn't get buried in old changelog entries. If this pattern looks good, I'm happy to follow up in a separate PR fixing up the documentation for the other components we have introduced experimental features for. |
||
| // First add the generic attributes like Category, EventId and Exception, | ||
| // so they are less likely being dropped because of AttributeCountLimit. | ||
|
|
||
|
|
@@ -109,7 +113,7 @@ internal static OtlpLogs.LogRecord ToOtlpLog(this LogRecord logRecord, SdkLimitO | |
| otlpLogRecord.AddStringAttribute(SemanticConventions.AttributeExceptionMessage, logRecord.Exception.Message, attributeValueLengthLimit, attributeCountLimit); | ||
| otlpLogRecord.AddStringAttribute(SemanticConventions.AttributeExceptionStacktrace, logRecord.Exception.ToInvariantString(), attributeValueLengthLimit, attributeCountLimit); | ||
| } | ||
|
|
||
| #endif | ||
| bool bodyPopulatedFromFormattedMessage = false; | ||
| if (logRecord.FormattedMessage != null) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.