Closed protonmarco closed 3 months ago
Hi,
It appears we set that interval value using the handler's address:
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/gnmi/handler.go#L94-L97
@srebhan thoughts on stripping the port?
@powersj I think we should strip it but I'm not sure if this isn't causing regressions for people...
@protonmarco,
We chatted about this a bit today. I think the general consensus is for users to use a processor to modify the tag. Changing the tag could have an impact on existing users and keeping the port seems to make sense to avoid any user with multiple ports from the same host.
One possible processor option would look like:
[[processors.regex]]
[[processors.regex.tags]]
key = "source"
pattern = "^(.*):.*$"
replacement = "${1}"
to transform:
-- metric,source=host:8888 value=42 1723663884492728297
++ metric,source=host value=42 1723663968544286648
@powersj the provided processors works perfectly, thanks. Regarding the regression problem, for what it's worth, i would be surprised to see someone else other than me using it, as iirc this internal metric is not even documented outside of https://github.com/influxdata/telegraf/issues/13088
@protonmarco we did have a few "nobody uses this" assumptions in the past and were almost always wrong. :-) So let's not break things for users! Are we good to close this issue?
Fair enough, I'm proceeding to close this one, thanks again :)
Relevant telegraf.conf
Logs from Telegraf
System info
1.32.2, rocky linux 8.10
Docker
No response
Steps to reproduce
source="hostname"
whileinternal_gnmi_grpc_connection_status
hassource="hostname:57400"
Expected behavior
I would expect for
internal_gnmi_grpc_connection_status
to have a source label same as the gnmi metrics (no processors are in place for it currently), so without the port specified.Actual behavior
the internal metric has the port defined in the source label
internal_gnmi_grpc_connection_status{source="hostname:57400"}
Additional info
No response