tomkerkhove / promitor

Bringing Azure Monitor metrics where you need them.
https://promitor.io
MIT License
248 stars 91 forks source link

Provide support for automatically discovering Azure subscriptions #1665

Open ahurtaud opened 3 years ago

ahurtaud commented 3 years ago

Proposal

Hello,

As of today, the list of subscriptions has to be set to resource-discovery-declaration.yaml in the azureLandscape key. I would like the resource-discovery component to automatically discover this list of subscriptions so that when a new one is created in the tenant, the resources of that subscriptions are automatically scraped by the scraper (thanks to the already available "monitor multiple subscriptions" feature on the scraper.

use case

I want to monitor all cpu of any VM of any subscription:

That would make it completely automatic regardless of subscriptions creation/deletion.

technical input

I have thought of using this API to do so: https://docs.microsoft.com/en-us/rest/api/resources/subscriptions/list

but this is part of resource management and not graph.

Thank you for consideration

Component

Resource Discovery

Contact Details

alban.hurtaud@amadeus.com

tomkerkhove commented 3 years ago

Thank you for the suggestion!

tomkerkhove commented 3 years ago

Is it fair to assume those subscriptions are all in the same Azure AD tenant?

tomkerkhove commented 3 years ago

POCed it and should be feasible.

ahurtaud commented 3 years ago

I would also add the subscription name (displayName?) to metrics alongside the subscriptionid as label, this shouldn't increase cardinality as 1-1 matching with the subscriptionid and easier to filter by name when we have a lot of subscriptions.

tomkerkhove commented 3 years ago

That might be possible, but what about cases whare no resource discovery is being used?

There would be inconsistent metric labels though. I'll think about it.

JeremyBoulanger commented 2 years ago

Hello, I am also interested by these features, do you think we could have them soon? If the second part is tricky, is it possible to split this issue in 2 ? I mean 1 issue for discovering Azure subscriptions and another for the subscription displayName label.

tomkerkhove commented 2 years ago

It's coming in v0.1.0 and will most likely be split indeed, but this will definitely be added.