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.

[BUG] Query 'Properties' returns 0 results

See original GitHub issue

Library name and version

Azure.Monitor.Query 1.1.0

Describe the bug

I’m attempting to use the LogsQueryClient to pull data from a Log Analytics workspace and having issues with the query.

Using the following queries I’m getting inconsistent results when the ‘Properties’ field is used in a Kusto query:

AppMetrics | where Name == ‘PublicationView’ and Properties has ‘R2P9780986027956’ => returns 0 results with LogsClientQuery.QueryWorkspaceAsync / Log query in Azure workspace returns 174 results with same query

AppMetrics | where Name == ‘PublicationView’ and Properties has ‘R2P9780986027956’ and TimeGenerated between (datetime(‘2022-07-01 00:00:00’) … datetime(‘2022-07-06 23:59:59’)) => returns 0 results with LogsClientQuery.QueryWorkspaceAsync / Log query in Azure workspace returns 42 results with same query

AppMetrics | where Name == ‘PublicationView’ and TimeGenerated between (datetime(‘2022-07-01 00:00:00’) … datetime(‘2022-07-06 23:59:59’)) => returns 716 results with LogsClientQuery.QueryWorkspaceAsync / Log query in Azure workspace returns 716 results with same query

Expected behavior

Using the following code, the LogsQueryClient should return 42 results.

var query = $"AppMetrics | where Name == '{metricType}' and Properties has '{metricNamespace}'"; var response = await _logsQueryClient.QueryWorkspaceAsync(_workspaceId, query, new QueryTimeRange(startDate, endDate));

metricType = PublicationView metricNamespace = ‘R2P9780986027956’ startDate = ‘2022-07-01 00:00:00’ endDate = ‘2022-07-06 23:59:59’

Actual behavior

0 results are returned. Removing " and Properties has ‘{metricNamespace}’" does return results but any usage of Properties in the query returns 0 results PropertiesInAzure .

Reproduction Steps

` var credential = new ClientSecretCredential(tenantId, clientId, clientSecret); _logsQueryClient = new LogsQueryClient(credential);

var startDate = DateTime.Parse(“2022-07-01 00:00:00”); var endDate = DateTime.Parse(“2022-07-06 23:59:59”); var metricType = “PublicationView”; var metricNamespace = “R2P9780986027956”;

var query = $“AppMetrics | where Name == ‘{metricType}’ and Properties has ‘{metricNamespace}’”; var response = await _logsQueryClient.QueryWorkspaceAsync(_workspaceId, query, new QueryTimeRange(startDate, endDate)); `

Environment

Visual Studio 2022 (17.2.5)

.NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481

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.301\

Host (useful for support): Version: 6.0.6 Commit: 7cca709db2

.NET SDKs installed: 3.1.420 [C:\Program Files\dotnet\sdk] 6.0.102 [C:\Program Files\dotnet\sdk] 6.0.106 [C:\Program Files\dotnet\sdk] 6.0.202 [C:\Program Files\dotnet\sdk] 6.0.203 [C:\Program Files\dotnet\sdk] 6.0.301 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ArkeBcacycommented, Jul 13, 2022

@scottaddie Here is the requested screenshot. IsError does say false and Status does return 200. Let me know if I can provide you any additional information.

GetMetricIssue

0reactions
scottaddiecommented, Jul 20, 2022

@ArkeBcacy Nothing that I’m aware of has changed in the service or client library. I’ll close this issue for now, but please let me know if you see this issue again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display default value if query results in no records ...
I'd like to either just display a message when an empty table is the result, or return a row with some default values....
Read more >
GoogleBigQueryConnector Query returns no results
Features read = 0. I can run the SQL query fine on the BigQuery Console. I've also entered the fields for the exposed...
Read more >
Why do I get zero records when I query my Amazon Athena ...
Queries that run on the example table return zero records. This is because the property's file locations projected correspond to midnight s3:// ...
Read more >
Error messages | BigQuery
Error message HTTP code Description stopped 200 This status code returns when a job is canceled. timeout 400 The job timed out.
Read more >
error - Query returning no results
Assign the SOQL query result back to a List<Property__c> . You can then check the size() of the resulting list. This will avoid...
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