[AOT] Removed support for ParseStateValues if the state neither implements IReadOnlyList nor IEnumberable when ParseStateValues is true.#4560
Conversation
c1caf1f to
d59c258
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4560 +/- ##
==========================================
+ Coverage 84.88% 84.92% +0.03%
==========================================
Files 313 313
Lines 12604 12594 -10
==========================================
- Hits 10699 10695 -4
+ Misses 1905 1899 -6
|
eerhardt
left a comment
There was a problem hiding this comment.
Assuming @utpilla and @CodeBlanch are fine with this change, LGTM.
ParseStateValues is true.
4fb135a to
136cec1
Compare
| ## Unreleased | ||
|
|
||
| * **Breaking Change** Removed support for ParseStateValues if the state | ||
| implements neither IReadOnlyList nor IEnumberable when `ParseStateValues` is |
There was a problem hiding this comment.
| implements neither IReadOnlyList nor IEnumberable when `ParseStateValues` is | |
| implements neither `IReadOnlyList<KeyValuePair<string, object>>` nor `IEnumerable<KeyValuePair<string, object>>` when `ParseStateValues` is |
There was a problem hiding this comment.
Same for:
- https://github.com/open-telemetry/opentelemetry-dotnet/pull/4560/files#diff-f1b040b01138ef7a10c01209ca53e58d20b78bb4580eafa0f51030b01d529145R316
- https://github.com/open-telemetry/opentelemetry-dotnet/pull/4560/files#diff-48886d84cf3065379188763f0948382a1b89bf9ebf9bdef6f8146fa6acf4776eR196
There was a problem hiding this comment.
@CodeBlanch Should we be using this instead?
IReadOnlyList<out T> nor IEnumerable<out T> where T is KeyValuePair<string, object>.
|
|
||
| return Array.Empty<KeyValuePair<string, object?>>(); | ||
| } | ||
| OpenTelemetrySdkEventSource.Log.LoggerProcessStateSkipped<TState>(typeof(TState).FullName!, "This can be fixed by updating the state to be a type that implements either IReadOnlyList<KeyValuePair<string, object>> or IEnumerable<KeyValuePair<string, object>>."); |
There was a problem hiding this comment.
Update the documentation of ParseStateValues option to reflect this change.
There was a problem hiding this comment.
Just FYI removing this code ParseStateValues essentially does nothing. Should we obsolete it?
There was a problem hiding this comment.
That would break build for users who have used this option in their Logs SDK setup, right?
There was a problem hiding this comment.
#4334 redefines ParseStateValues.
With the redefined ParseStateValues, value of public bool ParseStateValues { get; set; } is default to false and only should be set to true if state does not implement either IReadOnlyList or IEnumerable if users want to get the properties with Reflection.
Shall we obsolete this API in this PR or use a follow-up PR for that?
There was a problem hiding this comment.
Shall we obsolete this API in this PR or use a follow-up PR for that?
It should be its own PR (if at all we decide to do that).
|
This change was merged in #4619 |
Towards #3429
Changes
Most TStates implements IReadOnlyList and IEnumerable.
Added a event to log a warning for states, which requires fetching properties at runtime, will be skipped if
RuntimeFeature.IsDynamicCodeSupportedevaluates to false.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes