question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] How to get the TraceRecords from a query to ApiManagementGatewayLogs

See original GitHub issue

Library 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:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PramodValavala-MSFTcommented, Mar 15, 2022

@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.

0reactions
tracker1commented, Mar 22, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ApiManagementGatewayLogs
Reference for ApiManagementGatewayLogs table in Azure Monitor Logs. ... TraceRecords, dynamic, Records emitted by trace policies.
Read more >
Can you query the ApiManagementGatewayLogs in Azure ...
I want to query the ApiManagementGatewayLogs table for an API Management service in Azure using Invoke-AzOperationalInsightsQuery. I can query ...
Read more >
Log Analytics Advanced Queries
Log Analytics Advanced Queries ; // Find all processes that started in the last 3 days. ID 4688: A new process has been...
Read more >
How to track requests after integrating APIM with Logic App ...
Navigate to the Log Analytics workspace of Logic App, we could run the Kusto query below to retrieve the log with tracked properties....
Read more >
Query large amount of data from Log Analytics
Hi all, I am pretty new to the PowerBI topic and already ran in to some issues. I am trying to query a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found