Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 25 additions & 2 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,32 @@
name which resembles the package version of the SDK.
([#4375](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4375))

* 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, obsoleted `LogRecord.State` and `LogRecord.StateValues` properties, and
added `LogRecord.Body` and `LogRecord.Attributes` properties.
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 (even if
`OpenTelemetryLoggerOptions.IncludeFormattedMessage` is set to `false`).
([#4334](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334))

## 1.5.0-alpha.2
Expand Down