RobustPerception / azure_metrics_exporter

Azure metrics exporter for Prometheus
Apache License 2.0
133 stars 70 forks source link

No Support for Microsoft.DBForPostgreSql/flexibleServers #107

Closed VivekDevops closed 3 years ago

VivekDevops commented 3 years ago

I am trying to export metrics for azure postgres flexible server. Post configuration, i am getting the below error.

2021/09/05 21:25:36 Using managed identity 2021/09/05 21:25:38 azure_metrics_exporter listening on port :9276 2021/09/05 21:25:47 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers

--list.definition and namespace works though.

`/etc/azure-metrics-exporter # /bin/azure_metrics_exporter --config.file=/etc/azure-metrics-exporter/azure.yml --list.definitions 2021/09/05 20:44:38 Using managed identity 2021/09/05 20:44:39 Resource: /resourceGroups//providers/Microsoft.DBForPostgreSql/flexibleServers/

Available Metrics: 2021/09/05 20:44:39 - backup_storage_used 2021/09/05 20:44:39 - cpu_credits_consumed 2021/09/05 20:44:39 - cpu_credits_remaining 2021/09/05 20:44:39 - cpu_percent 2021/09/05 20:44:39 - memory_percent 2021/09/05 20:44:39 - iops 2021/09/05 20:44:39 - disk_queue_depth 2021/09/05 20:44:39 - read_throughput 2021/09/05 20:44:39 - write_throughput 2021/09/05 20:44:39 - read_iops 2021/09/05 20:44:39 - write_iops 2021/09/05 20:44:39 - storage_percent 2021/09/05 20:44:39 - storage_used 2021/09/05 20:44:39 - storage_free 2021/09/05 20:44:39 - txlogs_storage_used 2021/09/05 20:44:39 - active_connections 2021/09/05 20:44:39 - network_bytes_egress 2021/09/05 20:44:39 - network_bytes_ingress 2021/09/05 20:44:39 - connections_failed 2021/09/05 20:44:39 - connections_succeeded 2021/09/05 20:44:39 - maximum_used_transactionIDs`

brian-brazil commented 3 years ago

Hmm, might we need a newer version of the library?

VivekDevops commented 3 years ago

Yea, looks there is a new providers api version. https://docs.microsoft.com/en-us/rest/api/resources/providers old api-version=2019-05-10 needs to be updated with 2021-04-01

brian-brazil commented 3 years ago

Would you like to send a PR?

VivekDevops commented 3 years ago

Raised the PR. https://github.com/RobustPerception/azure_metrics_exporter/pull/108

brian-brazil commented 3 years ago

I presume this is fixed now?

VivekDevops commented 3 years ago

sadly, the problem still persists.

[jenkins@pgaztest01-bastion ~ ]$ kubectl logs -n cloudops azure-metrics-exporter -f 2021/09/07 04:18:36 Using managed identity 2021/09/07 04:18:39 azure_metrics_exporter listening on port :9276 2021/09/07 04:18:50 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers 2021/09/07 04:19:50 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers 2021/09/07 04:20:50 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers 2021/09/07 04:21:50 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers 2021/09/07 04:22:50 Failed to get resource info: No api version found for type: Microsoft.DBForPostgreSql/flexibleServers

brian-brazil commented 3 years ago

I'm afraid I'm not familiar enough with Azure to know what's going on. I'd suggest double checking the docs and config.

VivekDevops commented 3 years ago

This turned out to be issue with some case inventiveness between the resourceType name as listed in portal as compared to the one returned by the https://docs.microsoft.com/en-us/rest/api/resources/providers api.

"Microsoft.DBforPostgreSQL/flexibleServers" --> as returned by the provider api "Microsoft.DBForPostgreSql/flexibleServers" --> as listed in the portal.

The problem sorted after I modified the target name with proper case in the azure.yml configuration