Closed peterbaumert closed 1 year ago
Are you sure the gnmi encoding is right? The config has encoding = "json_ietf"
but it doesn't seem to be decoding correctly.
Could you also rerun your config with telegraf --test
and post the output so we can see what the gnmi input plugin is producing? The error you included came from the prometheus output. It might be more simple to debug if we avoid using the output plugin entirely.
See log:
fyi all ips replaced with 0.0.0.0 output is the same for "json" and "json_ietf", ios xe only supports that anyway see Programmability Configuration Guide, Cisco IOS XE Cupertino 17.8.x
@peterbaumert can you please output the collected metrics as influx-line-protocol e.g. by adding another outputs.file
instance with data_format = "influx"
!?
According to prometheus' code labels cannot start with a number but they have to start with a letter or underscore. This is a limitation of prometheus in combination with how your device reports the paths for your subscription (i.e. starting with a number).
There is little from the Telegraf side we can do in the plugins, but you can easily fix the issue by adding a regex processor to your config
[[processors.regex]]
namepass = ["oc-interfaces"]
[[processors.regex.field_rename]]
pattern = "^([^a-zA-Z_].*)$"
replacement = "if${1}"
Does that solve your problem @peterbaumert?
Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.24.1 (git: HEAD@bd7d53fb), Debian GNU/Linux 11 (bullseye)
Docker
No response
Steps to reproduce
Expected behavior
Telegraf outputs interface stats in prometheus metrics
Actual behavior
only above errors are shown
Additional info
No response