Hello dear experts,
Need help please removing a metric from gNMI input.
gNMI input config is as follows:
[[inputs.gnmi]]
addresses = [ "" ]
username = ""
password = ""
encoding = "json"
redial = "10s"
keepalive_time = "15s"
keepalive_timeout = "90s"
tls_enable = false
namedrop = [ "ttest_port_stats_egress_queue_queue_queue_id" ]
[[inputs.gnmi.subscription]]
name = "ttest_egress_queue"
origin = "nokia-state"
path = "/state/port[port-id=*]/statistics/egress-queue/queue[queue-id=*]/drop-unicast-packets"
subscription_mode = "sample"
sample_interval = "60s"
[[inputs.gnmi.subscription]]
name = "ttest_port_stats"
origin = "nokia-state"
path = "/state/port[port-id=*]/statistics/"
subscription_mode = "sample"
sample_interval = "60s"
[[processors.enum]]
[[processors.converter]]
[processors.converter.fields]
integer = ["out_*", "in_*", "up_time", "drop_unicast_packets", "drop_multicast_packets", "drop_unicast_octets", "drop_multicast_octets"]
The problem is that “/state/port[port-id=*]/statistics/” produces some nested metrics, one of which I need to remove.
This problematic metric looks like that when I curl telegraf:9273/metrics:
ttest_port_stats_egress_queue_queue_queue_id{
egress_queue_queue_drop_multicast_octets="0",
egress_queue_queue_drop_unicast_octets="0",
egress_queue_queue_forward_multicast_octets="0",
egress_queue_queue_forward_multicast_packets="0",
egress_queue_queue_forward_unicast_octets="33450830",
egress_queue_queue_forward_unicast_packets="365075",
path="/state/port/statistics/egress-queue/queue",
port_id="x",
queue_id="1",
rmrw="allowed",
source="127.0.0.1"
} 1
I want to get rid of this metric, but still be able to subscribe to “/state/port[port-id=*]/statistics/egress-queue/queue[queue-id=*]/drop-unicast-packets”
I also tried:
namedrop = [ "*queue_id" ]
namedrop = [ "*queue_queue_id" ]
namedrop = [ "queue_id" ]
tagdrop = [ "egress_queue_queue_forward_unicast_packets" ]
fieldexclude = [ "egress_queue_queue_forward_unicast_packets", "queue_id" ]
But still I see the metric in telegraf and in Grafana.
