Apply splitting to Azure Monitor metrics query with Azure.Monitor.Query
See original GitHub issueLibrary name and version
Azure.Monitor.Query 1.1.0
Query/Question
Is it possible to do splitting with Azure.Monitor.Query
SDK when retrieving Monitor metrics?
I’m trying to retrieve metrics for a service bus account, split by EntityName. This is possible in the portal:
This is the code that I have. I can retrieve the metrics but don’t know how to apply the splitting.
var credential = new ClientSecretCredential(_tenantId, _clientId, _clientSecret);
var metricsClient = new MetricsQueryClient(credential);
var resourceId = $"/subscriptions/{_subscriptionId}/resourceGroups/{_resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{_serviceBusName}";
var metrics = new[] { "ScheduledMessages", "ActiveMessages" };
var options = new MetricsQueryOptions();
options.Aggregations.Add(MetricAggregationType.Total);
options.TimeRange = TimeSpan.FromHours(4);
var result = await metricsClient.QueryResourceAsync(resourceId, metrics, options);
Environment
IDE: Visual Studio 17.5.3.
dotnet --info
results:
.NET SDK:
Version: 7.0.202
Commit: 6c74320bc3
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.202\
Host:
Version: 7.0.5
Architecture: x64
Commit: 8042d61b17
Issue Analytics
- State:
- Created 5 months ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Metrics in Azure Monitor
Learn about metrics in Azure Monitor, which are lightweight monitoring data capable of supporting near real-time scenarios.
Read more >Advanced features of Metrics Explorer - Azure Monitor
Apply splitting · Above the chart, select Apply splitting. · Choose dimensions on which to segment your chart: · Choose a limit on...
Read more >Azure Monitor Query client library for .NET
The Azure Monitor Query client library is used to execute read-only ... Handle metrics query response; Query metrics with options; Split a ...
Read more >Get started with metrics explorer - Azure Monitor
Learn how to create your first metric chart with Azure Monitor metrics explorer. ... Apply dimension filters and splitting.
Read more >Azure Monitor metrics aggregation and display explained
When we apply splitting, we can see the underlying data, but it's a bit of a mess. Turns out there are 20 VMs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good point this should be better documented. Splitting and filtering actually both use the same filter parameter the only difference is splitting is where the filter value is equal to *. So an example of splitting is:
An example of filtering is:
I’ll get this documented in our README file