Replies: 3 comments
-
|
Can you share the output of ConsoleExporter with the strong type? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Absolutely, here it is: Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@DoubleTK please check out this dotnet/extensions#6785 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm hoping to better understand how the .NET instrumentation library works with the
[LogProperties]attribute, as it's not behaving how I expect. I'm working on a project that can receiveExportLogServiceRequestmessages and make them available for query. When the project receives theExportLogServiceRequest, and/or when I query it, the data types of theAttributesproperties are not what I expect. Here are the relevant code snippets:The
FoodRecalNoticecontains both a nested object,Product, and a collection ofLocationobjects to outline the issue.I have a
[LoggerMessage]to log this object:And I log it like this:
Expected behavior
I expected the nested object to be serialized as a
KeyValueList, and I expected the list of locations to be serialized as anArrayValue, like so:{ "attributes": [ { "key": "Product", "value": { "kvlistValue": { "values": [ { "key": "Description", "value": { "stringValue": "Salads" } }, { "key": "Type", "value": { "stringValue": "Food & Beverages" } } ] } } }, { "key": "AffectedLocations", "value": { "arrayValue": { "values": [ { "kvlistValue": { "values": [ { "key": "City", "value": { "stringValue": "Seattle" } }, { "key": "State", "value": { "stringValue": "WA" } } ] } }, { "kvlistValue": { "values": [ { "key": "City", "value": { "stringValue": "Denver" } }, { "key": "State", "value": { "stringValue": "CO" } } ] } } ] } } } ] }Actual Behavior
Nested objects and collections are serialized to a
StringValuerather than my expectedArrayValueandKeyValueListdata types.{ "attributes": [ { "key": "Product", "value": { "stringValue": "Product { Description = Salads, Type = Food & Beverages }" } }, { "key": "AffectedLocations", "value": { "stringValue": "['Location { City = Seattle, State = WA }','Location { City = Denver, State = CO }']" } } ] }Am I missing something here, or is this by design?
Beta Was this translation helpful? Give feedback.
All reactions