From cae7a226a1c6863064a761ba9f1cea6f5904f50e Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Thu, 20 Apr 2023 13:28:45 -0700 Subject: [PATCH 1/3] CHANGELOG tweaks to cover PR feedback. --- .../CHANGELOG.md | 12 +++++++++--- src/OpenTelemetry/CHANGELOG.md | 9 +++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs/CHANGELOG.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs/CHANGELOG.md index 1fae07de715..7273a4ffc43 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs/CHANGELOG.md @@ -3,11 +3,17 @@ ## Unreleased * The `OpenTelemetryLoggerOptions.AddOtlpExporter` extension no longer - automatically set `OpenTelemetryLoggerOptions.ParseStateValues` to `true`. + automatically sets `OpenTelemetryLoggerOptions.ParseStateValues` to `true`. + The OpenTelemetry SDK now automatically sets `Attributes` (aka `StateValues`) + for the common cases where `ParseStateValues` was previously required. + `ParseStateValues` can be set to `true` manually by users to enable parsing of + custom states which do not implement `IReadOnlyList` / `IEnumerable` + interfaces. ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) -* Updated to use the new `LogRecord.Attributes` field as `StateValues` is now - marked obsolete. +* Updated to use the new `LogRecord.Attributes` field as `LogRecord.StateValues` + is now marked obsolete. There is no impact to transmitted data (`StateValues` + and `Attributes` are equivalent). ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) ## 1.5.0-alpha.2 diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 698926494f7..9b60b80ee9c 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -16,8 +16,13 @@ ([#4375](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4375)) * Tweaked the behavior of the `OpenTelemetryLoggerOptions.ParseStateValues` - flag, obsoleted `LogRecord.State` and `LogRecord.StateValues` properties, and - added `LogRecord.Body` and `LogRecord.Attributes` properties. + flag (attributes are now automatically included for most log messages by + default), obsoleted `LogRecord.State` and `LogRecord.StateValues` properties, + and added `LogRecord.Body` and `LogRecord.Attributes` properties. + ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) + +* If a template (`{OriginalFormat}` attribute) cannot be found on log messages a + formatted message will now automatically be generated. ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) ## 1.5.0-alpha.2 From 8aff8355a5af51b35b11be842972060d34474f40 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 21 Apr 2023 15:07:11 -0700 Subject: [PATCH 2/3] Code review. --- src/OpenTelemetry/CHANGELOG.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 9b60b80ee9c..b030c76e64b 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -15,14 +15,32 @@ name which resembles the package version of the SDK. ([#4375](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4375)) -* Tweaked the behavior of the `OpenTelemetryLoggerOptions.ParseStateValues` - flag (attributes are now automatically included for most log messages by - default), obsoleted `LogRecord.State` and `LogRecord.StateValues` properties, - and added `LogRecord.Body` and `LogRecord.Attributes` properties. +* Obsoleted `State` and `StateValues` properties and added `Body` and + `Attributes` properties on `LogRecord`. Note: `LogRecord.Attributes` and + `LogRecord.StateValues` point to the same data. "Attributes" is what the + OpenTelemetry Specification defines so this was changed for clarity & + consistency with the specification. ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) +* Tweaked the behavior of the `OpenTelemetryLoggerOptions.ParseStateValues` + flag: + + * `LogRecord.Attributes` (aka `LogRecord.StateValues`) are now automatically + included for all log messages with states implementing `IReadOnlyList` or + `IEnumerable`. + + * `OpenTelemetryLoggerOptions.ParseStateValues` is now used to tell the SDK to + parse (using reflection) attributes for custom states which do not implement + `IReadOnlyList` or `IEnumerable`. Only top-level properties are included. + + * `LogRecord.State` will only be set to the raw state object if no attributes + are found. + + See [#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334) for details. + * If a template (`{OriginalFormat}` attribute) cannot be found on log messages a - formatted message will now automatically be generated. + formatted message will now automatically be generated (even if + `OpenTelemetryLoggerOptions.IncludeFormattedMessage` is set to `false`). ([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334)) ## 1.5.0-alpha.2 From 7f449f7f38ea696bc6209eeb5d0fea218b1acfc9 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Tue, 25 Apr 2023 13:49:05 -0700 Subject: [PATCH 3/3] MD lint. --- src/OpenTelemetry/CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index b030c76e64b..196fa55acde 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -24,7 +24,7 @@ * Tweaked the behavior of the `OpenTelemetryLoggerOptions.ParseStateValues` flag: - + * `LogRecord.Attributes` (aka `LogRecord.StateValues`) are now automatically included for all log messages with states implementing `IReadOnlyList` or `IEnumerable`. @@ -36,7 +36,8 @@ * `LogRecord.State` will only be set to the raw state object if no attributes are found. - See [#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334) for details. + See [#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334) + for details. * If a template (`{OriginalFormat}` attribute) cannot be found on log messages a formatted message will now automatically be generated (even if