webdevops / azure-resourcemanager-exporter

Prometheus exporter for Azure ResourceManager informations (infos, quotas, limits, usages, public IPs, portscanner)
MIT License
33 stars 17 forks source link

How do I make the costs queries in this new version? #45

Closed aloysioc closed 1 year ago

aloysioc commented 1 year ago

How should we set the configuration parameter (--config)? When I try to use this parameter I get the following error:

2023-07-25T18:25:32.633868750Z {"level":"info","caller":"azure-resourcemanager-exporter/main.go:111","msg":"reading config from \"/home/centos/config.yaml\""} 2023-07-25T18:25:32.634201955Z {"level":"fatal","caller":"azure-resourcemanager-exporter/main.go:115","msg":"open /home/centos/config.yaml: no such file or directory","stacktrace":"main.initConfig\n\t/go/src/github.com/webdevops/azure-resourcemanager-exporter/main.go:115\nmain.main\n\t/go/src/github.com/webdevops/azure-resourcemanager-exporter/main.go:69\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}

aloysioc commented 1 year ago

Hi Markus. We were finally able to set the configuration parameter correctly, but we still couldn't create the metrics to read the customer's costs. Could you show examples of the queries to extract cost data from azure?

For example: Before these changes, my query was "COSTS_QUERY_PRD_MT_MTC_MTSC_RG=Meter,MeterCategory,MeterSubcategory,ResourceGroup". And now, how would it look?

Thanks in advance.

theok-nice commented 1 year ago

Better check this file

https://github.com/webdevops/azure-resourcemanager-exporter/blob/4b8304703720ddfe00a73e3121a4cf0b8643091b/example.yaml#L64-L105

aloysioc commented 1 year ago

Better check this file

https://github.com/webdevops/azure-resourcemanager-exporter/blob/4b8304703720ddfe00a73e3121a4cf0b8643091b/example.yaml#L64-L105

Could you give me a real example, please? What would be the composition referring to my old query: "COSTS_QUERY_PRD_MT_MTC_MTSC_RG=Meter,MeterCategory,MeterSubcategory,ResourceGroup"? Could you show me how it would look in the current version? Sorry, but despite the examples, I still haven't managed to assemble my data extraction.

Thanks in advance,

mblaschke commented 1 year ago

in the old version you had only the option to specify the dimensions, with the new version you can set all the query settings. just create a query with the dimensions you want.

keep in mind that the exporter is just a client to query cost metrics. it directly sends the query to the Azure Cost API which processes the query.

aloysioc commented 1 year ago

Hi Markus. Thank you for your help.

See you later.