oracle / oci-grafana-metrics

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

Metric label customization changes #131

Closed huskerdhf closed 2 years ago

huskerdhf commented 2 years ago

Overview

This PR encompasses the following changes to the metrics plugin related to how metrics labels are generated:

Example Use of Custom Metric Labels

The following screenshot shows a metrics dashboard with three rows where each row contains two data panels with the exact same query where the left side data panel has no custom legend format and the right side panel does have a defined custom legend format. Each of the rows present a metric from the oci_computeagent, oci_lbaas, and oci_objectstorage metric namespaces respectively.

ExampleMetricDataPanelsUsingCustomLabelFormat

Testing

The changes on this PR were tested in the following ways:

Documentation

The "using" section of the plugin documentation has been updated to reflect this new functionality as well as a few editorial updates.

mamorett commented 2 years ago

Hi @huskerdhf . I noticed this behaviour with the vnic metric: image Without legend format it displays correctly the vin ocid, still not the Displayname of that specific resources. Other resources works fine: image

huskerdhf commented 2 years ago

Hi @huskerdhf . I noticed this behaviour with the vnic metric: image Without legend format it displays correctly the vin ocid, still not the Displayname of that specific resources. Other resources works fine: image

The custom legend format for that metric can only be '{resourceId}' (or something similar with additional literal text) since there is only a single dimension of that name associated with the VnicFromNetworkBytes metric. Perhaps the documentation should say {\<dimension>} or {\<dimensionName>} to be clearer.

huskerdhf commented 2 years ago

Updated the PR to address two issues: