-
Notifications
You must be signed in to change notification settings - Fork 853
[otlp] Add log exception attributes under feature flag #4892
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 14 commits
106be5a
f4e1b83
001027b
aabf44d
1e2f552
7d284d6
982891f
fc2cfe2
98530ee
f32d098
559fa87
81fb7e5
e219db6
e0df512
21f188b
ac83adf
2413e1d
d73f493
c7b6f91
ab4cb52
d17aa23
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 |
|---|---|---|
|
|
@@ -2,6 +2,13 @@ | |
|
|
||
| ## Unreleased | ||
|
|
||
| * Added ability to export attributes corresponding to `LogRecord.Exception` i.e. | ||
| `exception.type`, `exception.message` and `exception.stacktrace`. These | ||
| attributes will be exported when | ||
| `OTEL_DOTNET_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES` environment variable will be | ||
| set to `true`. | ||
| ([#4892](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4892)) | ||
|
||
|
|
||
| * Bumped the version of `Google.Protobuf` used by the project to `3.22.5` so | ||
| that consuming applications can be published as NativeAOT successfully. Also, | ||
| a new performance feature can be used instead of reflection emit, which is | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // <copyright file="ExperimentalOptions.cs" company="OpenTelemetry Authors"> | ||
| // Copyright The OpenTelemetry Authors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // </copyright> | ||
|
|
||
| #nullable enable | ||
|
|
||
| using Microsoft.Extensions.Configuration; | ||
| using OpenTelemetry.Internal; | ||
|
|
||
| namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation; | ||
|
|
||
| internal sealed class ExperimentalOptions | ||
| { | ||
| public const string EMITLOGEXCEPTIONATTRIBUTES = "OTEL_DOTNET_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES"; | ||
|
|
||
| public ExperimentalOptions() | ||
| : this(new ConfigurationBuilder().AddEnvironmentVariables().Build()) | ||
| { | ||
| } | ||
|
|
||
| public ExperimentalOptions(IConfiguration configuration) | ||
| { | ||
| if (configuration.TryGetBoolValue(EMITLOGEXCEPTIONATTRIBUTES, out var emitLogExceptionAttributes)) | ||
| { | ||
| this.EmitLogExceptionAttributes = emitLogExceptionAttributes; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets a value indicating whether log exception attributes should be exported. | ||
| /// </summary> | ||
| public bool EmitLogExceptionAttributes { get; set; } = false; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.