Skip to content

Feature Request for Azure Monitor Metrics Data Plane Batch API Support #38651

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

Open
ashishbans opened this issue Mar 15, 2025 · 21 comments
Open
Labels
enhancement New feature or request needs triage New item requiring triage receiver/azuremonitor

Comments

@ashishbans
Copy link

ashishbans commented Mar 15, 2025

Component(s)

receiver/azuremonitor

Is your feature request related to a problem? Please describe.

Currently, the OpenTelemetry Collector's Azure integration uses the standard Azure Resource Manager (ARM) APIs for metrics collection, which has significant limitations:

  • Low query limits (12,000 API calls per hour)
  • Requirement to make separate API calls for each resource
  • Higher risk of throttling when monitoring many Azure resources
  • Lower performance for large-scale monitoring scenarios
  • These limitations create challenges for users monitoring large Azure environments with multiple resources, as they frequently encounter throttling issues and inefficient data collection.

Describe the solution you'd like

Implement support for the new Azure Monitor Metrics Data Plane API in the OpenTelemetry Collector. This API offers several significant advantages:

  • Higher query limits: Up to 360,000 API calls per hour (30x improvement over ARM API)
  • Batch capabilities: Collect metrics for up to 50 resource IDs in a single API call
  • Improved efficiency: Reduced number of API calls for the same amount of metric data
  • Regional endpoints: Using region-specific endpoints for better performance
  • The implementation should allow users to:
  • Configure the collector to use the new Metrics Data Plane API instead of ARM APIs
  • Specify Azure resource IDs to be monitored in batches
  • Take advantage of the higher throughput and reduced throttling risk

Describe alternatives you've considered

No response

Additional context

The Azure Monitor Metrics Data Plane API is Generally Available and represents a significant improvement in Azure monitoring capabilities. Key technical details:

@ashishbans ashishbans added enhancement New feature or request needs triage New item requiring triage labels Mar 15, 2025
Copy link
Contributor

Pinging code owners:

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

@celian-garcia
Copy link
Member

celian-garcia commented Mar 15, 2025

Thank you for this very detailed feature request. I'm actually planning to propose a PR from my fork that uses the getBatch API. This is the fork that we are using in my company for months already with good success!
I didn't know about this new API though. This is interesting, do you have go libraries associated?

@ashishbans
Copy link
Author

ashishbans commented Mar 17, 2025

Hey @celian-garcia , glad to know that your company already using getBatch API

It is same. Here is the go libraries for Batch API
https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery

@celian-garcia
Copy link
Member

celian-garcia commented Mar 17, 2025

Ok we're actually using github.com/Azure/azure-sdk-for-go/sdk/monitor/query/azmetrics
For the batch metrics API.
For ref: https://github.com/celian-garcia/opentelemetry-collector-contrib/blob/50ac164dc41074b64727deb16b7a207461b54508/receiver/azuremonitorreceiver/scraper_batch.go

We followed this doc https://github.com/Azure/azure-sdk-for-go/blob/main/sdk%2Fmonitor%2Fquery%2FMIGRATION.md

I was more asking for the dataplane API but I'm realising, reading again the doc that if we migrate to github.com/Azure/azure-sdk-for-go/sdk/monitor/query/azmetrics for everything, we should be good. Am I right?

@ashishbans ashishbans changed the title Feature Request for Azure Monitor Metrics Data Plane API Support Feature Request for Azure Monitor Metrics Data Plane Batch API Support Mar 18, 2025
@ashishbans
Copy link
Author

Hey @celian-garcia , yes, we are good and on right path,

FYI : also mentioned doc you shared
azmetrics contains a new data plane metrics feature that wasn't previously available in azquery. This allows users to query data from one or multiple resource IDs using a data plane endpoint. azmetrics will expand in the future when the service adds more features.

@ashishbans
Copy link
Author

ashishbans commented Mar 18, 2025

Also would you mind sharing the repo fork or pull request where this work is in progress. we also like to contribute to speedup the rollout

@celian-garcia
Copy link
Member

celian-garcia commented Mar 18, 2025

Okay. Currently I want to finish this #37167 (multi subscription support) before to rebase and propose a PR from my fork's branch about getBatch

I believe that it's the same for the azmetrics usage. I'd be glad to have your support on this! Can you just wait for the multi subscription config to be merged before starting to migrate to azmetrics. As otherwise we'd have some conflcts in tests.
Also you're more than welcome to review the code that we've done on both multi subscription and getBatch.

@celian-garcia
Copy link
Member

/label never-stale -needs-triage good-first-issue

@github-actions github-actions bot added never stale Issues marked with this label will be never staled and automatically removed good first issue Good for newcomers and removed needs triage New item requiring triage labels Mar 18, 2025
@ashishbans
Copy link
Author

@celian-garcia Sounds good. I'll go through it.
I found some references from another scrapping tool written in c#. feat: Provide support for batch scraping in Promitor

Using Batch Scraping with Azure Monitor API (Experimental)

@celian-garcia
Copy link
Member

Yes we know it already and migrated from it to otel col. I don't remember why but I'd say that it's easier for us to code in Go and otel col is the perfect place to have it, benefiting also from a larger community. That could give us some ideas of improvements. though of course!

For now, since we're using our fork now with quite a good result, I will focus on merging it as is but we take of course any feedback!

@celian-garcia
Copy link
Member

I'm not very confident about this label, I remove it.

/label -good-first-issue

@celian-garcia
Copy link
Member

/label -good-first-issue

@github-actions github-actions bot removed the good first issue Good for newcomers label Mar 19, 2025
@celian-garcia
Copy link
Member

@ashishbans I'm currently trying to add some tests for our fork that uses azmetrics package getBatch API.
I'm surprised to not find fake API but an internal unexposed mock that you are using in your tests internally.

Is there any plan to have a fake API like other clients?

@ashishbans
Copy link
Author

ashishbans commented Mar 25, 2025

Hey @celian-garcia , Glad to see we have made good progress on batchApi feature request.
Microsoft engineer has raised PR for azmetrics fake support. it should be merged soon.

@celian-garcia
Copy link
Member

@ashishbans oh great ! I thought it would take time when I saw the milestone so I started today implement my own fake server haha 😂

@ashishbans
Copy link
Author

Hey @celian-garcia
FYI: fake support PR has been meeged now. Thanks

@ashishbans
Copy link
Author

ashishbans commented Apr 8, 2025

Hello @celian-garcia , I wanted to check if there are any updates on this feature request. Thank you."

@celian-garcia
Copy link
Member

I was waiting for another PR about subscription name label. Now it's merge so I can rebase. I will try to make it before the end of the week.

atoulme pushed a commit that referenced this issue Apr 14, 2025
…h API (#38895)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Let me introduce the Batch Metrics API
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch/batch?view=rest-monitor-2023-10-01&tabs=HTTP

The advantages of using ``azmetrics`` batch metrics API over the
``armmonitor`` metrics API are described in details in the issue + in
the README.md

Note that this is a revival of a previous PR that we made last year, and
that has not been followed up properly but we're using that forked code
in the Amadeus company for months with good results.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Relates #38651

<!--Describe what testing was performed and which tests were added.-->
#### Testing
✅  Manual tests + mocked unit tests

<!--Describe the documentation added.-->
#### Documentation

✅  Added config field documentation in README.md
<!--Please delete paragraphs that you did not use before submitting.-->

Signed-off-by: Célian Garcia <[email protected]>
akshays-19 pushed a commit to akshays-19/opentelemetry-collector-contrib that referenced this issue Apr 23, 2025
…h API (open-telemetry#38895)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Let me introduce the Batch Metrics API
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch/batch?view=rest-monitor-2023-10-01&tabs=HTTP

The advantages of using ``azmetrics`` batch metrics API over the
``armmonitor`` metrics API are described in details in the issue + in
the README.md

Note that this is a revival of a previous PR that we made last year, and
that has not been followed up properly but we're using that forked code
in the Amadeus company for months with good results.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Relates open-telemetry#38651

<!--Describe what testing was performed and which tests were added.-->
#### Testing
✅  Manual tests + mocked unit tests

<!--Describe the documentation added.-->
#### Documentation

✅  Added config field documentation in README.md
<!--Please delete paragraphs that you did not use before submitting.-->

Signed-off-by: Célian Garcia <[email protected]>
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this issue Apr 24, 2025
…h API (open-telemetry#38895)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Let me introduce the Batch Metrics API
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch/batch?view=rest-monitor-2023-10-01&tabs=HTTP

The advantages of using ``azmetrics`` batch metrics API over the
``armmonitor`` metrics API are described in details in the issue + in
the README.md

Note that this is a revival of a previous PR that we made last year, and
that has not been followed up properly but we're using that forked code
in the Amadeus company for months with good results.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Relates open-telemetry#38651

<!--Describe what testing was performed and which tests were added.-->
#### Testing
✅  Manual tests + mocked unit tests

<!--Describe the documentation added.-->
#### Documentation

✅  Added config field documentation in README.md
<!--Please delete paragraphs that you did not use before submitting.-->

Signed-off-by: Célian Garcia <[email protected]>
@celian-garcia
Copy link
Member

Hi @ashishbans, I believe that this PR #38895 is actually closing this issue. I will close it and let your reopen if needed.

@celian-garcia
Copy link
Member

celian-garcia commented May 27, 2025

Okay I don't have rights to close 😄
at triager please close

@celian-garcia
Copy link
Member

/label -never-stale needs-triage

@github-actions github-actions bot added needs triage New item requiring triage and removed never stale Issues marked with this label will be never staled and automatically removed labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage receiver/azuremonitor
Projects
None yet
Development

No branches or pull requests

2 participants