#Custom metric
1 messages · Page 1 of 1 (latest)
See if this helps. You can add these to Harvest configuration.
https://netapp.github.io/harvest/24.02/configure-harvest-basic/#labels
is it global label? I want to add labels for metric (Cluster_new_status)
Yes it is global and it will apply to all metrics.
We don't have a way just to add static labels to a specific metric. Could you open a feature request for this https://github.com/NetApp/harvest/issues
Of course I can open a new question. Is it possible to add a custom metric?
We can add custom metrics to Harvest templates using plugins (https://netapp.github.io/harvest/24.02/plugins/). In your example, if these labels are coming from ONTAP, we can add them to custom_new_status. However, if they are static labels, then currently there is no support for adding them to a specific metric.
Can you give me an example according to my conditions? I don't quite understand how to implement this
Are these are static labels which can change per cluster?
If you are okay with applying them to all metrics of a poller, then as I shared earlier, you can make changes as mentioned here.
https://netapp.github.io/harvest/24.02/configure-harvest-basic/#labels
These are static labels, but I need one metric so that I can apply two different label values.An example picture from another exporter. That is, the metric is the same, the labels are the same, but the label values are different
Understood.In your example of cluster_new_status, the Location and vCenter will vary per poller. We currently don't have support to make such changes for a specific metric. It is only available at a global level, which is still per poller level but applies to all metrics of that poller. So, essentially, all metrics of that poller will have these labels, but these labels can change for different pollers.
Can this be done through a custom template for each storage system?
It is not possible currently. We'll need to implement such feature in Harvest.
@idle aurora I believe you can also achieve what you want with a static label in your targets like this https://stackoverflow.com/questions/49829423/prometheus-add-target-specific-label-in-static-configs