Closed
Description
Component(s)
receiver/azuremonitor
What happened?
Description
From the following thread #38895 (comment)
There are two issues that should be fixed at once:
- First The metrics aggregation filter feature has been well backported to the scraper_batch, to add aggregation into composite key but the composite key is not used in the query to get metrics 😲
- Second, there is arbitrarily chosen
if metricValue.Average != nil {
before processing the metrics, which is obviously unwanted now that we can filter out the metrics. The reason of that choice and possible solutions are explained in the thread.
Steps to Reproduce
Special thanks to @andrewegel with this perfect reproduction #40078
I'm copy pasting it there
azuremonitor:
auth: default_credentials
subscription_ids: [...one-subscription...]
use_batch_api: true
append_tags_as_attributes: true
services:
- "Microsoft.Network/loadBalancers"
- "Microsoft.Network/natgateways"
metrics:
"Microsoft.Network/loadBalancers":
"VipAvailability": [average]
"DipAvailability": [average]
"ByteCount": [total]
"SYNCount": [count, total]
"SnatConnectionCount": [total]
"AllocatedSnatPorts": [average]
"UsedSnatPorts": [average]
"Microsoft.Network/natgateways":
"SNATConnectionCount": [total]
"ByteCount": [total]
"DatapathAvailability": [average]
collection_interval: 300s
initial_delay: 1s
Expected Result
We expect the metrics for which you don't have average in the filter (e,g ByteCount, SYNCount, ...) to appear in the result.
Actual Result
Only metrics that does have "average" in their filter appear in the result.
Collector version
v0.126.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
No response