Skip to content

[receiver/azuremonitorreceiver] feat: multi subscriptions support and automatic discovery #36467

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
wants to merge 1 commit into from

Conversation

celian-garcia
Copy link
Member

@celian-garcia celian-garcia commented Nov 20, 2024

Description

This PR allows to discover and scrape all the subscriptions located in the tenant.
I'm adding also at the same time the ability to give multiple subscriptions as it's free and can also be desired.

This is a part of this PR: #29593 that has been split for readability.
Indeed in a next PR, I'll propose the usage of the getBatch of metrics Azure API. Because if your tenant contains a lot of subscription, you can face rate limitations.

It contains also a little refactor of the tests and the "backdoor" used to mock the API. Now the tests are using the way provided by Azure: the fake API. https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes
The "backdoor" is now only the client options. So no weird interfaces nor weird constructor for the Azure clients inside the scraper.go file.

Link to tracking issue

Fixes #36612

Testing

Documentation

@celian-garcia celian-garcia marked this pull request as ready for review November 25, 2024 15:12
@celian-garcia celian-garcia requested a review from a team as a code owner November 25, 2024 15:12
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Dec 25, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 9, 2025
… automatic discovery

Signed-off-by: Célian Garcia <celian.garcia@amadeus.com>
@github-actions github-actions bot removed the Stale label Jan 10, 2025
@celian-garcia celian-garcia closed this by deleting the head repository Jan 13, 2025
atoulme added a commit that referenced this pull request Mar 21, 2025
… automatic discovery (#37167)

Recreated from a diffferent fork. Context:
#36467

> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
> Ex. Adding a feature - Explain what this achieves.-->
> #### Description
> 
> This PR allows to discover and scrape all the subscriptions located in
the tenant.
> I'm adding also at the same time the ability to give multiple
subscriptions as it's free and can also be desired.
> 
> This is a part of this PR:
#29593
that has been split for readability.
> Indeed in a next PR, I'll propose the usage of the getBatch of metrics
Azure API. Because if your tenant contains a lot of subscription, you
can face rate limitations.
> 
> 
> It contains also a little refactor of the tests and the "backdoor"
used to mock the API. Now the tests are using the way provided by Azure:
the fake API.
https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes
> The "backdoor" is now only the client options. So no weird interfaces
nor weird constructor for the Azure clients inside the ``scraper.go``
file.
> 
> <!-- Issue number (e.g. #1234) or full URL to issue, if applicable.
-->
> #### Link to tracking issue
> Fixes #36612
> 
> <!--Describe what testing was performed and which tests were added.-->
> #### Testing
> 
> <!--Describe the documentation added.-->
> #### Documentation
> 
> <!--Please delete paragraphs that you did not use before
submitting.-->

Thanks to the tests refactoring, closes #31264 (at best it fixes it, at
worst this makes it obsolete), relates also #38639

Signed-off-by: Célian Garcia <celian.garcia@amadeus.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this pull request Apr 24, 2025
… automatic discovery (open-telemetry#37167)

Recreated from a diffferent fork. Context:
open-telemetry#36467

> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
> Ex. Adding a feature - Explain what this achieves.-->
> #### Description
> 
> This PR allows to discover and scrape all the subscriptions located in
the tenant.
> I'm adding also at the same time the ability to give multiple
subscriptions as it's free and can also be desired.
> 
> This is a part of this PR:
open-telemetry#29593
that has been split for readability.
> Indeed in a next PR, I'll propose the usage of the getBatch of metrics
Azure API. Because if your tenant contains a lot of subscription, you
can face rate limitations.
> 
> 
> It contains also a little refactor of the tests and the "backdoor"
used to mock the API. Now the tests are using the way provided by Azure:
the fake API.
https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes
> The "backdoor" is now only the client options. So no weird interfaces
nor weird constructor for the Azure clients inside the ``scraper.go``
file.
> 
> <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable.
-->
> #### Link to tracking issue
> Fixes open-telemetry#36612
> 
> <!--Describe what testing was performed and which tests were added.-->
> #### Testing
> 
> <!--Describe the documentation added.-->
> #### Documentation
> 
> <!--Please delete paragraphs that you did not use before
submitting.-->

Thanks to the tests refactoring, closes open-telemetry#31264 (at best it fixes it, at
worst this makes it obsolete), relates also open-telemetry#38639

Signed-off-by: Célian Garcia <celian.garcia@amadeus.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/azuremonitorreceiver] feat: multi subscriptions support and automatic discovery
2 participants