oracle / oci-grafana-metrics

Grafana datasource plugin for OCI metrics
https://grafana.com/grafana/plugins/oci-metrics-datasource
Universal Permissive License v1.0
80 stars 40 forks source link

Auto Window and Resolution settings not working #218

Closed Tomson124 closed 8 months ago

Tomson124 commented 1 year ago

After quite some troubleshooting the plugin is working, but when creating my first panels I noticed that the data source is not working when setting a relative time for the query. It seems the auto setting for window and resolution doesn't work then, since after checking I saw, that the window and resolution in the JSON Query sent, is 1 minute. That is too short, so no data comes back. After setting them manually to 5 minutes (for my "the month so far" -> 26 days) it works.

Not sure if it is possible to detect the relative time and apply the correct window and resolution setting the same way it works for the "normal" dashboard time ranges.

grafik

mamorett commented 8 months ago

This is due to the fact OCI Cloud has some restrictions in terms of returned data points and intervals available for different time ranges. You may reference here: https://docs.oracle.com/en-us/iaas/Content/Monitoring/Reference/mql.htm. The two levels of restrictions (total amount of data points and interval per time ranges) may need adjustments, specially when querying metrics with a large amount of datapoints, therefore there is not a single interval settings working in each situation, but may depends on the metric query you are requesting.