I am using a prometheus plugin in Telegraf to get the data from promitor and push it to InfluxDB. However, as per my requirement there is one tag named as "resource_name" and it contains multiple values let's say ["A", "B", "C", "D", "E", "F", "G", "H"]. Out of these values I only want ["A", "B", "C", "D", "E"] and these only values should be inserted into InfluxDB.
To achieve my requirement I am using below plugin and using tagpass to allow only specific values.
[[inputs.prometheus]]
metric_version = 2
name_suffix = "_promitor_abcd"
urls = ["http://IP:Port/metrics"]
tagexclude = [ "host", "url" ]
[inputs.prometheus.tagpass]
resource_name = [ "A", "B", "C", "D", "E" ]
After using this when I run this configuration file I am still able to see all the values in InfluxDB under "resource_name" tag or column and not the values which I specified above in my configuration file.
Can anybody help me to understand what went wrong here and how to push only specific values in influxDB?
The
tagpass
parameter is one of the available metric filters in telegraf.tagpass
is specific to the tag key and value. Metrics that contain keys and values specified bytagpass
are emitted. So if you have a metric as follows:For exmaple the following tagpass config:
Would pass any metrics with the height tag. You can place any value you want to filter on, with globs supported as well.
Thanks!