Open mboret opened 4 years ago
I have the same issue. Someone found a solution for this?
Same issue. No solution?
Hi
I've investigated this issue as I need this working as well. I think I found the cause
The problem with this is that the "UsedCapacity" metric seems to be exported at a much slower rate than other metrics. By default, azure_metrics_exporter
uses a range of 1 minute. I think UsedCapacity needs a range of > 1h.
I tried to modify the code so that it queries for a larger interval
func GetTimes() (string, string) {
// Make sure we are using UTC
now := time.Now().UTC()
// Use query delay of 3 minutes when querying for latest metric data
endTime := now.Add(time.Minute * time.Duration(-3)).Format(time.RFC3339)
// ADDED "- time.Hour * 6"
startTime := now.Add(time.Minute * time.Duration(-4) - time.Hour * 6).Format(time.RFC3339)
return endTime, startTime
}
And it does indeed work.
I believe a fix for this would be to include an additional configuration parameter, such as "range_seconds", that would be used to configure this period.
I'm linking the PR
Hi,
I'm not able to get the Azure storage account usedcapacity metric, the exporter always gives me back 0(should be 181.8MiB).
I can see differences between the request made by Azure portal to get the usedcapacity metric en the one made by Prometheus.
Azure portal:
"/subscriptions/XXXXXXXXX/resourceGroups/rg-dev/providers/Microsoft.Storage/storageAccounts/devwww/providers/microsoft.Insights/metrics?timespan=2019-11-11T15:35:00.000Z/2019-11-12T15:35:00.000Z&interval=FULL&metricnames=UsedCapacity&aggregation=average&metricNamespace=microsoft.storage%2Fstorageaccounts&validatedimensions=false&api-version=2019-07-01"
Prometheus Exporter:
/subscriptions/XXXXXXXXXXXXXX/resourceGroups/rg-dev/providers/Microsoft.Storage/storageAccounts/devwww/providers/microsoft.insights/metrics?aggregation=Total%2CAverage%2CMinimum%2CMaximum&api-version=2018-01-01&metricnames=UsedCapacity×pan=2019-11-12T15%3A41%3A53Z%2F2019-11-12T15%3A42%3A53Z
Prometheus gives me
I've modify the exporter's code to generate a request with parameters like the Azure portal.
/subscriptions/XXXXXXX/resourceGroups/rg-dev/providers/Microsoft.Storage/storageAccounts/probstgwww/providers/microsoft.Insights/metrics?aggregation=average&api-version=2019-07-01&autoadjusttimegrain=true&interval=PT5M&metricNamespace=microsoft.storage%2Fstorageaccounts&metricnames=UsedCapacity×pan=2019-11-12T15%3A36%3A48Z%2F2019-11-12T15%3A37%3A48Z&validatedimensions=false
But the exporter still gives me 0.
My configuration:
Any idea?
Thanks