[QUERY] How to get the TraceRecords from a query to ApiManagementGatewayLogs
See original GitHub issueLibrary name and version
Azure.Monitor.Query 1.1.0
Query/Question
I’m using LogsQueryClient
to query ApiManagementGatewayLogs
, I am seeing most row data without issue… however I’m unable to figure out how to get data out of the TraceRecords
column in the rows… when serializing to JSON output for viewing in logs, it prints {}
for the TraceRecords field.
Can someone provide an example of how to read this data out?
Environment
I’m using VS Code, with dotnet run
in the terminal window.
OS: Windows 10 21H2
❯ dotnet --info .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff
Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.100\
Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa
.NET SDKs installed: 5.0.403 [C:\Program Files\dotnet\sdk] 6.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
@tracker1 I can confirm that values that have varied structure based on the query,
BinaryData
is returned which is just serialized JSON data. Parsing this string is the expected way to consume this data.I will work with the concerning team to add this to the packages’ README.
@PramodValavala-MSFT thank you for confirming this… it was just kind of difficult to determine for me, since looking at the inspector in VS didn’t reveal anything, and it just wasn’t clear from the docs.
Glad it’s getting documented.