Hi,
I’m collecting metrics from windows machine and there is an exec plugin, emitting certain metrics which contain some measurements I need to handle differently (rename). Exec plugin looks like this:
[[inputs.exec]]
commands = [
'powershell -ExecutionPolicy Bypass -File "C:\metrics.ps1"'
]
timeout = "10s"
data_format = "prometheus"
and it yields following:
# HELP prometheus_processes_total Telegraf collected metric
# TYPE prometheus_processes_total untyped
prometheus_processes_total{host="WIN-5O9RBMT2QOC"} 100
# HELP prometheus_processes_total_threads Telegraf collected metric
# TYPE prometheus_processes_total_threads untyped
prometheus_processes_total_threads{host="WIN-5O9RBMT2QOC"} 808
Now, I would like to strip prefix prometheus_
from the measurement name using this config for rename
processor :
[[processors.rename]]
# tried with and without namepass, doesn't change anything
namepass = ["prometheus_*"]
[[processors.rename.replace]]
measurement = "prometheus_processes_total_threads"
dest = "processes_total_threads"
[[processors.rename.replace]]
measurement = "prometheus_processes_total"
dest = "processes_total"
but it’s not working at all. Can anyone tell me what I am doing wrong here?
Thanks