promitor icon indicating copy to clipboard operation
promitor copied to clipboard

Provide support for automatically discovering Azure subscriptions

Open ahurtaud opened this issue 3 years ago • 7 comments

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:

  • resource-discovery -> give tenantId and create a landscape for the VirtualMachines of every subscriptions
  • scraper -> create metrics regarding the CPU for all subscriptions given by the discovery component.

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

[email protected]

ahurtaud avatar Jun 29 '21 14:06 ahurtaud

Thank you for the suggestion!

tomkerkhove avatar Jul 02 '21 05:07 tomkerkhove

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

tomkerkhove avatar Jul 02 '21 05:07 tomkerkhove

POCed it and should be feasible.

tomkerkhove avatar Jul 06 '21 21:07 tomkerkhove

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.

ahurtaud avatar Jul 07 '21 07:07 ahurtaud

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.

tomkerkhove avatar Jul 07 '21 07:07 tomkerkhove

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.

JeremyBoulanger avatar Nov 23 '21 08:11 JeremyBoulanger

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

tomkerkhove avatar Nov 23 '21 08:11 tomkerkhove