Skip to content
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

Is it possible to specify the subscription and resource group in the azure-metrics-exporter config instead of Prometheus? #79

Open
johnswarbrick-napier opened this issue Feb 26, 2024 · 2 comments

Comments

@johnswarbrick-napier
Copy link

johnswarbrick-napier commented Feb 26, 2024

I have two related issues:

(1) I want to specify the Azure subscription as an environment variable that is passed automatically to azure-metrics-exporter instead of specifying it manually in the Prometheus scrape config;

(2) I want to specify the resource group as an environment variable that is password automatically to azure-metrics-monitor so the results are always filtered to the given resource group name;

I tried passing the subscription ID from a Kubernetes secret already, but it seems I still need to specify the subscription ID in the Prometheus scape config?

   - name: AZURE_SERVICEDISCOVERY_SUBSCRIPTION_ID
     valueFrom:
       secretKeyRef:
         key: subscription
         name: azure-resource-details
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Mon, 26 Feb 2024 17:37:01 GMT
Content-Length: 36

parameter "subscription" is missing

And there doesn't seem to be any method of specifying the resource group as an environment variable at all in the docs?

The reason is that I am currently using an identical Prometheus scraping configuration across more than 100 clusters, and I don't want to manually specify the subscription ID or resource group individually within each cluster.

And I need to filter by resource group to prevent azure-metrics-exporter from returning metrics for a resource group that I don't want reporting into Grafana.

These are the startup logs:

image

Thanks :)

@johnswarbrick-napier
Copy link
Author

Hi - any thoughts on this at all?

@davejhahn
Copy link

@johnswarbrick-napier

        params:
          name: ["my-name"]
          subscription:
          - <subscriptionId>
          filter: ["(resourceGroup eq '<rg_name>' or resourceGroup eq '<rg_name>') and resourceType eq '<res_type>'"]

I'm just trying to figure out how to do the same for resource name. There are resources in Azure that have different metrics depending on the implementation, e.g. Cognitive Services, and the metrics available are different, so trying to filter by name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants