Skip to content

[receiver/azuremonitorreceiver] metrics aggregation filter unused and slightly with current use_batch_api:true implementation #40079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
celian-garcia opened this issue May 14, 2025 · 4 comments · Fixed by #40091
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed receiver/azuremonitor

Comments

@celian-garcia
Copy link
Member

celian-garcia commented May 14, 2025

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

@celian-garcia celian-garcia added bug Something isn't working needs triage New item requiring triage labels May 14, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@celian-garcia celian-garcia changed the title metrics aggregation filter unused and slightly with current use_batch_api:true implementation [receiver/azuremonitorreceiver] metrics aggregation filter unused and slightly with current use_batch_api:true implementation May 14, 2025
@celian-garcia
Copy link
Member Author

/labels -needs-triage help-wanted good-first-issue

@github-actions github-actions bot added help wanted Extra attention is needed good first issue Good for newcomers and removed needs triage New item requiring triage labels May 14, 2025
@celian-garcia
Copy link
Member Author

/labels never-stale

@github-actions github-actions bot added the never stale Issues marked with this label will be never staled and automatically removed label May 14, 2025
@celian-garcia
Copy link
Member Author

Well considered, I will check it myself, as I have a good understanding of the problem and it's easy to unblock.
/labels -help-wanted

dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this issue May 23, 2025
…en ``use_batch_api: true`` (open-telemetry#40091)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This is following a previous PR for adding support of Azure Batch API,
in which I failed to backport the support of metrics aggregation filter.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#40079
Mentioned as an issue in open-telemetry#40078

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Changed one of the mocked data to cover the problems mentioned in the
issue.
Useless to create a specific config with metric aggregation filters as
it would create query option ignored by the mock and the code is driven
behind by the mock data.

<!--Describe the documentation added.-->
#### Documentation
N/A
<!--Please delete paragraphs that you did not use before submitting.-->

Signed-off-by: Célian Garcia <[email protected]>
Co-authored-by: Antoine Toulme <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed receiver/azuremonitor
Projects
None yet
1 participant