grafana / azure-monitor-datasource

Grafana data source for Azure Monitor/Application Insights (deprecated - now included in core Grafana)
Apache License 2.0
92 stars 29 forks source link

Azure Billing monitoring #81

Open bhozar opened 5 years ago

bhozar commented 5 years ago

Would it be possible to add Azure billing monitoring to the code back as a data source? Would be helpful to have the cost data along with the rest of the available data, and when alerting is finally available, alerting that there has been increaes in costs along with the other metrics.

Microsoft have published some API's for access to the Azure Usage and Rates: https://docs.microsoft.com/en-us/azure/billing/billing-usage-rate-card-overview

aurelijus-vaiciulionis commented 5 years ago

Hi. You can use Prometheus with BlueYonder Azure Costs Exporter for billing monitoring.

perjahn commented 5 years ago

Azure's usage and rate apis are quite slow and unreliable, using those apis as a data source for a dashboard wouldn't be very useful, you probably want to store the exported costs somewhere else from where it's faster and more robust to retrieve them, as Aurelijus suggested. (For me it takes 2h to export a month of usage, and sometimes I get http/500. The api returns duplicates, and all kinds of other inconsistencies)

Also, the usage+rate apis needs some logic applied, i.e. to get actual costs, you need to multiply usage with rate, including price bracketing logic, i.e. not a simple data source. There's also a billing api for retrieving invoice information, don't know if it would be more convenient to use.

Here's a tool I wrote to export costs to elasticsearch: https://github.com/perjahn/getazurecosts

yesoreyeram commented 4 years ago

If anyone interested, check this. https://github.com/yesoreyeram/grafana-azure-datasource

image

One minor issue : Multi subscription queries not possible at the time of writing. Also no support for alerts

aurelijus-vaiciulionis commented 4 years ago

If anyone interested, check this. https://github.com/yesoreyeram/grafana-azure-datasource

image

One minor issue : Multi subscription queries not possible at the time of writing. Also no support for alerts

Hello. Can you provide information (or update readme) on how to install and use it?

yesoreyeram commented 4 years ago

@aurelijus-vaiciulionis that is same as any other plugin. Download the repo and put it in your plugin folder. Configure the plugin Same as inbuilt azure monitor plugin. Plugin still in early state of development. So expect delay in updating README file and other documents