influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.51k stars 5.56k forks source link

Inconsistent / missing path tags for gNMI input #14946

Closed sebastianw closed 6 months ago

sebastianw commented 6 months ago

Relevant telegraf.conf

[global_tags]
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = "0s"
  hostname = ""
  omit_hostname = false
[[outputs.discard]]
[[outputs.file]]
  files = ["gnmi.out"]
  data_format = "influx"
 [[outputs.file]]
   files = ["gnmi.out.prom"]
   data_format = "prometheus"
[[outputs.prometheus_client]]
  listen = "127.0.0.1:9273"
  metric_version = 2
  path = "/metrics"
  expiration_interval = "0"
[[inputs.gnmi]]
  addresses = ["arista-switch:6030"]
  username = "HIDDEN"
  password = "HIDDEN"
  redial = "60s"
  tls_enable = true
  insecure_skip_verify = true
  [[inputs.gnmi.subscription]]
    name = "gnmi_ifcounters"
    path = "/interfaces/interface/state/counters"
    subscription_mode = "sample"
    sample_interval = "10s"
  [[inputs.gnmi.subscription]]
    name = "gnmi_transceiver_dom"
    path = "/components/component/transceiver/physical-channels/channel/state"
    subscription_mode = "sample"
    sample_interval = "30s"
  [[inputs.gnmi.subscription]]
    name = "gnmi_sys_cpu"
    path = "/system/cpus/cpu/state"
    subscription_mode = "sample"
    sample_interval = "10s"
  [[inputs.gnmi.subscription]]
    name = "gnmi_sys_memory"
    path = "/system/memory/state"
    subscription_mode = "sample"
    sample_interval = "10s"
  [[inputs.gnmi.subscription]]
    name = "gnmi_bgp"
    path = "/network-instances/network-instance/protocols/protocol[name=BGP]/bgp/neighbors/neighbor/state"
    subscription_mode = "sample"
    sample_interval = "10s"

Logs from Telegraf

2024-03-06T14:39:06Z I! Loading config: ./telegraf.conf
2024-03-06T14:39:06Z I! Starting Telegraf 1.29.5 brought to you by InfluxData the makers of InfluxDB
2024-03-06T14:39:06Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 5 secret-stores
2024-03-06T14:39:06Z I! Loaded inputs: gnmi
2024-03-06T14:39:06Z I! Loaded aggregators:
2024-03-06T14:39:06Z I! Loaded processors:
2024-03-06T14:39:06Z I! Loaded secretstores:
2024-03-06T14:39:06Z I! Loaded outputs: discard file (2x) prometheus_client
2024-03-06T14:39:06Z I! Tags enabled: host=tanagra
2024-03-06T14:39:06Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"tanagra", Flush Interval:10s
2024-03-06T14:39:06Z D! [agent] Initializing plugins
2024-03-06T14:39:06Z D! [inputs.gnmi] Internal alias mapping: map[/interfaces/interface/state/counters:gnmi_ifcounters /components/component/transceiver/physical-channels/channel/state:gnmi_transceiver_dom /system/cpus/cpu/state:gnmi_sys_cpu /system/memory/state:gnmi_sys_memory /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state:gnmi_bgp]
2024-03-06T14:39:06Z D! [agent] Connecting outputs
2024-03-06T14:39:06Z D! [agent] Attempting connection to [outputs.discard]
2024-03-06T14:39:06Z D! [agent] Successfully connected to outputs.discard
2024-03-06T14:39:06Z D! [agent] Attempting connection to [outputs.file]
2024-03-06T14:39:06Z D! [agent] Successfully connected to outputs.file
2024-03-06T14:39:06Z D! [agent] Attempting connection to [outputs.file]
2024-03-06T14:39:06Z D! [agent] Successfully connected to outputs.file
2024-03-06T14:39:06Z D! [agent] Attempting connection to [outputs.prometheus_client]
2024-03-06T14:39:06Z I! [outputs.prometheus_client] Listening on http://127.0.0.1:9273/metrics
2024-03-06T14:39:06Z D! [agent] Successfully connected to outputs.prometheus_client
2024-03-06T14:39:06Z D! [agent] Starting service inputs
2024-03-06T14:39:06Z D! [inputs.gnmi] Connection to gNMI device arista-switch:6030 established
2024-03-06T14:39:16Z D! [outputs.discard] Wrote batch of 460 metrics in 958ns
2024-03-06T14:39:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:16Z D! [outputs.prometheus_client] Wrote batch of 460 metrics in 4.715417ms
2024-03-06T14:39:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:16Z D! [outputs.file] Wrote batch of 460 metrics in 9.528958ms
2024-03-06T14:39:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:16Z D! [outputs.file] Wrote batch of 460 metrics in 14.481875ms
2024-03-06T14:39:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:26Z D! [outputs.discard] Wrote batch of 369 metrics in 791ns
2024-03-06T14:39:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:26Z D! [outputs.prometheus_client] Wrote batch of 369 metrics in 3.438541ms
2024-03-06T14:39:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:26Z D! [outputs.file] Wrote batch of 369 metrics in 5.103292ms
2024-03-06T14:39:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:26Z D! [outputs.file] Wrote batch of 369 metrics in 10.742334ms
2024-03-06T14:39:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:36Z D! [outputs.discard] Wrote batch of 374 metrics in 292ns
2024-03-06T14:39:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:36Z D! [outputs.prometheus_client] Wrote batch of 374 metrics in 1.594833ms
2024-03-06T14:39:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:36Z D! [outputs.file] Wrote batch of 374 metrics in 2.410958ms
2024-03-06T14:39:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:36Z D! [outputs.file] Wrote batch of 374 metrics in 7.659208ms
2024-03-06T14:39:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:46Z D! [outputs.discard] Wrote batch of 450 metrics in 1.083µs
2024-03-06T14:39:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:46Z D! [outputs.prometheus_client] Wrote batch of 450 metrics in 3.456875ms
2024-03-06T14:39:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:46Z D! [outputs.file] Wrote batch of 450 metrics in 6.601583ms
2024-03-06T14:39:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:46Z D! [outputs.file] Wrote batch of 450 metrics in 12.497584ms
2024-03-06T14:39:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:56Z D! [outputs.discard] Wrote batch of 377 metrics in 792ns
2024-03-06T14:39:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:56Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 2.549042ms
2024-03-06T14:39:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:56Z D! [outputs.file] Wrote batch of 377 metrics in 6.883209ms
2024-03-06T14:39:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:39:56Z D! [outputs.file] Wrote batch of 377 metrics in 13.357959ms
2024-03-06T14:39:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:06Z D! [outputs.discard] Wrote batch of 375 metrics in 708ns
2024-03-06T14:40:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:06Z D! [outputs.prometheus_client] Wrote batch of 375 metrics in 2.179167ms
2024-03-06T14:40:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:06Z D! [outputs.file] Wrote batch of 375 metrics in 4.667167ms
2024-03-06T14:40:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:06Z D! [outputs.file] Wrote batch of 375 metrics in 12.168209ms
2024-03-06T14:40:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:16Z D! [outputs.discard] Wrote batch of 459 metrics in 500ns
2024-03-06T14:40:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:16Z D! [outputs.prometheus_client] Wrote batch of 459 metrics in 3.112667ms
2024-03-06T14:40:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:16Z D! [outputs.file] Wrote batch of 459 metrics in 8.7875ms
2024-03-06T14:40:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:16Z D! [outputs.file] Wrote batch of 459 metrics in 15.566625ms
2024-03-06T14:40:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:26Z D! [outputs.discard] Wrote batch of 378 metrics in 417ns
2024-03-06T14:40:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:26Z D! [outputs.prometheus_client] Wrote batch of 378 metrics in 1.320833ms
2024-03-06T14:40:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:26Z D! [outputs.file] Wrote batch of 378 metrics in 3.72125ms
2024-03-06T14:40:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:26Z D! [outputs.file] Wrote batch of 378 metrics in 9.779666ms
2024-03-06T14:40:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:36Z D! [outputs.discard] Wrote batch of 376 metrics in 542ns
2024-03-06T14:40:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:36Z D! [outputs.prometheus_client] Wrote batch of 376 metrics in 1.642792ms
2024-03-06T14:40:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:36Z D! [outputs.file] Wrote batch of 376 metrics in 4.536958ms
2024-03-06T14:40:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:36Z D! [outputs.file] Wrote batch of 376 metrics in 10.122291ms
2024-03-06T14:40:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:46Z D! [outputs.discard] Wrote batch of 458 metrics in 625ns
2024-03-06T14:40:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:46Z D! [outputs.prometheus_client] Wrote batch of 458 metrics in 2.635709ms
2024-03-06T14:40:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:46Z D! [outputs.file] Wrote batch of 458 metrics in 5.905125ms
2024-03-06T14:40:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:46Z D! [outputs.file] Wrote batch of 458 metrics in 13.937917ms
2024-03-06T14:40:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:56Z D! [outputs.discard] Wrote batch of 377 metrics in 917ns
2024-03-06T14:40:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:56Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 2.199083ms
2024-03-06T14:40:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:56Z D! [outputs.file] Wrote batch of 377 metrics in 6.610167ms
2024-03-06T14:40:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:40:56Z D! [outputs.file] Wrote batch of 377 metrics in 14.988709ms
2024-03-06T14:40:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:06Z D! [outputs.discard] Wrote batch of 379 metrics in 917ns
2024-03-06T14:41:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:06Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 9.032375ms
2024-03-06T14:41:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:06Z D! [outputs.file] Wrote batch of 379 metrics in 13.559541ms
2024-03-06T14:41:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:06Z D! [outputs.file] Wrote batch of 379 metrics in 15.717209ms
2024-03-06T14:41:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:16Z D! [outputs.discard] Wrote batch of 460 metrics in 417ns
2024-03-06T14:41:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:16Z D! [outputs.prometheus_client] Wrote batch of 460 metrics in 1.988875ms
2024-03-06T14:41:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:16Z D! [outputs.file] Wrote batch of 460 metrics in 5.221ms
2024-03-06T14:41:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:16Z D! [outputs.file] Wrote batch of 460 metrics in 13.432625ms
2024-03-06T14:41:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:26Z D! [outputs.discard] Wrote batch of 377 metrics in 583ns
2024-03-06T14:41:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:26Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 3.078333ms
2024-03-06T14:41:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:26Z D! [outputs.file] Wrote batch of 377 metrics in 5.857375ms
2024-03-06T14:41:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:26Z D! [outputs.file] Wrote batch of 377 metrics in 10.87525ms
2024-03-06T14:41:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:36Z D! [outputs.discard] Wrote batch of 374 metrics in 417ns
2024-03-06T14:41:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:36Z D! [outputs.prometheus_client] Wrote batch of 374 metrics in 1.755ms
2024-03-06T14:41:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:36Z D! [outputs.file] Wrote batch of 374 metrics in 3.921708ms
2024-03-06T14:41:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:36Z D! [outputs.file] Wrote batch of 374 metrics in 10.412125ms
2024-03-06T14:41:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:46Z D! [outputs.discard] Wrote batch of 459 metrics in 792ns
2024-03-06T14:41:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:46Z D! [outputs.prometheus_client] Wrote batch of 459 metrics in 4.542125ms
2024-03-06T14:41:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:46Z D! [outputs.file] Wrote batch of 459 metrics in 8.645917ms
2024-03-06T14:41:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:46Z D! [outputs.file] Wrote batch of 459 metrics in 11.074833ms
2024-03-06T14:41:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:56Z D! [outputs.discard] Wrote batch of 380 metrics in 500ns
2024-03-06T14:41:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:56Z D! [outputs.prometheus_client] Wrote batch of 380 metrics in 2.11675ms
2024-03-06T14:41:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:56Z D! [outputs.file] Wrote batch of 380 metrics in 3.855458ms
2024-03-06T14:41:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:41:56Z D! [outputs.file] Wrote batch of 380 metrics in 9.669583ms
2024-03-06T14:41:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:06Z D! [outputs.discard] Wrote batch of 378 metrics in 584ns
2024-03-06T14:42:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:06Z D! [outputs.prometheus_client] Wrote batch of 378 metrics in 1.813167ms
2024-03-06T14:42:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:06Z D! [outputs.file] Wrote batch of 378 metrics in 4.159583ms
2024-03-06T14:42:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:06Z D! [outputs.file] Wrote batch of 378 metrics in 14.106792ms
2024-03-06T14:42:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:16Z D! [outputs.discard] Wrote batch of 462 metrics in 542ns
2024-03-06T14:42:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:16Z D! [outputs.prometheus_client] Wrote batch of 462 metrics in 3.37575ms
2024-03-06T14:42:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:16Z D! [outputs.file] Wrote batch of 462 metrics in 5.105541ms
2024-03-06T14:42:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:16Z D! [outputs.file] Wrote batch of 462 metrics in 9.194792ms
2024-03-06T14:42:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:26Z D! [outputs.discard] Wrote batch of 379 metrics in 667ns
2024-03-06T14:42:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:26Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 2.093417ms
2024-03-06T14:42:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:26Z D! [outputs.file] Wrote batch of 379 metrics in 5.232916ms
2024-03-06T14:42:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:26Z D! [outputs.file] Wrote batch of 379 metrics in 8.566834ms
2024-03-06T14:42:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:36Z D! [outputs.discard] Wrote batch of 374 metrics in 709ns
2024-03-06T14:42:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:36Z D! [outputs.prometheus_client] Wrote batch of 374 metrics in 2.107291ms
2024-03-06T14:42:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:36Z D! [outputs.file] Wrote batch of 374 metrics in 5.390542ms
2024-03-06T14:42:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:36Z D! [outputs.file] Wrote batch of 374 metrics in 8.939ms
2024-03-06T14:42:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:46Z D! [outputs.discard] Wrote batch of 460 metrics in 500ns
2024-03-06T14:42:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:46Z D! [outputs.prometheus_client] Wrote batch of 460 metrics in 3.034583ms
2024-03-06T14:42:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:46Z D! [outputs.file] Wrote batch of 460 metrics in 11.927166ms
2024-03-06T14:42:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:46Z D! [outputs.file] Wrote batch of 460 metrics in 10.729542ms
2024-03-06T14:42:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:56Z D! [outputs.discard] Wrote batch of 378 metrics in 583ns
2024-03-06T14:42:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:56Z D! [outputs.prometheus_client] Wrote batch of 378 metrics in 2.555875ms
2024-03-06T14:42:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:56Z D! [outputs.file] Wrote batch of 378 metrics in 6.245583ms
2024-03-06T14:42:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:42:56Z D! [outputs.file] Wrote batch of 378 metrics in 9.377458ms
2024-03-06T14:42:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:06Z D! [outputs.discard] Wrote batch of 381 metrics in 667ns
2024-03-06T14:43:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:06Z D! [outputs.prometheus_client] Wrote batch of 381 metrics in 2.199625ms
2024-03-06T14:43:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:06Z D! [outputs.file] Wrote batch of 381 metrics in 5.975375ms
2024-03-06T14:43:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:06Z D! [outputs.file] Wrote batch of 381 metrics in 9.734ms
2024-03-06T14:43:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:16Z D! [outputs.discard] Wrote batch of 460 metrics in 542ns
2024-03-06T14:43:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:16Z D! [outputs.prometheus_client] Wrote batch of 460 metrics in 1.620959ms
2024-03-06T14:43:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:16Z D! [outputs.file] Wrote batch of 460 metrics in 6.284709ms
2024-03-06T14:43:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:16Z D! [outputs.file] Wrote batch of 460 metrics in 9.095083ms
2024-03-06T14:43:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:26Z D! [outputs.discard] Wrote batch of 379 metrics in 1.042µs
2024-03-06T14:43:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:26Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 2.401041ms
2024-03-06T14:43:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:26Z D! [outputs.file] Wrote batch of 379 metrics in 7.280792ms
2024-03-06T14:43:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:26Z D! [outputs.file] Wrote batch of 379 metrics in 10.501458ms
2024-03-06T14:43:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:36Z D! [outputs.discard] Wrote batch of 379 metrics in 1.125µs
2024-03-06T14:43:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:36Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 2.755084ms
2024-03-06T14:43:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:36Z D! [outputs.file] Wrote batch of 379 metrics in 7.835541ms
2024-03-06T14:43:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:36Z D! [outputs.file] Wrote batch of 379 metrics in 10.277583ms
2024-03-06T14:43:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:46Z D! [outputs.prometheus_client] Wrote batch of 464 metrics in 1.530625ms
2024-03-06T14:43:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:46Z D! [outputs.discard] Wrote batch of 464 metrics in 375ns
2024-03-06T14:43:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:46Z D! [outputs.file] Wrote batch of 464 metrics in 6.059166ms
2024-03-06T14:43:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:46Z D! [outputs.file] Wrote batch of 464 metrics in 9.08325ms
2024-03-06T14:43:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:56Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 1.42875ms
2024-03-06T14:43:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:56Z D! [outputs.discard] Wrote batch of 377 metrics in 500ns
2024-03-06T14:43:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:56Z D! [outputs.file] Wrote batch of 377 metrics in 4.190042ms
2024-03-06T14:43:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:43:56Z D! [outputs.file] Wrote batch of 377 metrics in 7.796208ms
2024-03-06T14:43:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:06Z D! [outputs.discard] Wrote batch of 380 metrics in 792ns
2024-03-06T14:44:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:06Z D! [outputs.prometheus_client] Wrote batch of 380 metrics in 4.133292ms
2024-03-06T14:44:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:06Z D! [outputs.file] Wrote batch of 380 metrics in 9.154ms
2024-03-06T14:44:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:06Z D! [outputs.file] Wrote batch of 380 metrics in 13.548166ms
2024-03-06T14:44:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:16Z D! [outputs.discard] Wrote batch of 458 metrics in 417ns
2024-03-06T14:44:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:16Z D! [outputs.prometheus_client] Wrote batch of 458 metrics in 1.741958ms
2024-03-06T14:44:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:16Z D! [outputs.file] Wrote batch of 458 metrics in 5.53ms
2024-03-06T14:44:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:16Z D! [outputs.file] Wrote batch of 458 metrics in 11.608417ms
2024-03-06T14:44:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:26Z D! [outputs.discard] Wrote batch of 377 metrics in 584ns
2024-03-06T14:44:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:26Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 2.292542ms
2024-03-06T14:44:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:26Z D! [outputs.file] Wrote batch of 377 metrics in 5.569083ms
2024-03-06T14:44:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:26Z D! [outputs.file] Wrote batch of 377 metrics in 10.44625ms
2024-03-06T14:44:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:36Z D! [outputs.prometheus_client] Wrote batch of 373 metrics in 1.941083ms
2024-03-06T14:44:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:36Z D! [outputs.discard] Wrote batch of 373 metrics in 667ns
2024-03-06T14:44:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:36Z D! [outputs.file] Wrote batch of 373 metrics in 6.839375ms
2024-03-06T14:44:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:36Z D! [outputs.file] Wrote batch of 373 metrics in 10.724542ms
2024-03-06T14:44:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:46Z D! [outputs.prometheus_client] Wrote batch of 463 metrics in 1.970708ms
2024-03-06T14:44:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:46Z D! [outputs.discard] Wrote batch of 463 metrics in 834ns
2024-03-06T14:44:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:46Z D! [outputs.file] Wrote batch of 463 metrics in 6.6605ms
2024-03-06T14:44:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:46Z D! [outputs.file] Wrote batch of 463 metrics in 11.581333ms
2024-03-06T14:44:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:56Z D! [outputs.prometheus_client] Wrote batch of 380 metrics in 1.692959ms
2024-03-06T14:44:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:56Z D! [outputs.file] Wrote batch of 380 metrics in 5.923416ms
2024-03-06T14:44:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:56Z D! [outputs.discard] Wrote batch of 380 metrics in 458ns
2024-03-06T14:44:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:44:56Z D! [outputs.file] Wrote batch of 380 metrics in 10.317458ms
2024-03-06T14:44:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:06Z D! [outputs.prometheus_client] Wrote batch of 380 metrics in 2.683041ms
2024-03-06T14:45:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:06Z D! [outputs.discard] Wrote batch of 380 metrics in 542ns
2024-03-06T14:45:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:06Z D! [outputs.file] Wrote batch of 380 metrics in 6.642916ms
2024-03-06T14:45:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:06Z D! [outputs.file] Wrote batch of 380 metrics in 10.972875ms
2024-03-06T14:45:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:16Z D! [outputs.prometheus_client] Wrote batch of 459 metrics in 1.868417ms
2024-03-06T14:45:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:16Z D! [outputs.discard] Wrote batch of 459 metrics in 542ns
2024-03-06T14:45:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:16Z D! [outputs.file] Wrote batch of 459 metrics in 6.019708ms
2024-03-06T14:45:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:16Z D! [outputs.file] Wrote batch of 459 metrics in 11.043042ms
2024-03-06T14:45:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:26Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 2.46425ms
2024-03-06T14:45:26Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:26Z D! [outputs.discard] Wrote batch of 377 metrics in 875ns
2024-03-06T14:45:26Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:26Z D! [outputs.file] Wrote batch of 377 metrics in 8.073292ms
2024-03-06T14:45:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:26Z D! [outputs.file] Wrote batch of 377 metrics in 13.501083ms
2024-03-06T14:45:26Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:36Z D! [outputs.prometheus_client] Wrote batch of 375 metrics in 2.828125ms
2024-03-06T14:45:36Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:36Z D! [outputs.discard] Wrote batch of 375 metrics in 625ns
2024-03-06T14:45:36Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:36Z D! [outputs.file] Wrote batch of 375 metrics in 6.679833ms
2024-03-06T14:45:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:36Z D! [outputs.file] Wrote batch of 375 metrics in 10.676375ms
2024-03-06T14:45:36Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:46Z D! [outputs.prometheus_client] Wrote batch of 462 metrics in 5.985584ms
2024-03-06T14:45:46Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:46Z D! [outputs.discard] Wrote batch of 462 metrics in 541ns
2024-03-06T14:45:46Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:46Z D! [outputs.file] Wrote batch of 462 metrics in 8.583333ms
2024-03-06T14:45:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:46Z D! [outputs.file] Wrote batch of 462 metrics in 13.070625ms
2024-03-06T14:45:46Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:56Z D! [outputs.prometheus_client] Wrote batch of 377 metrics in 1.76275ms
2024-03-06T14:45:56Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:56Z D! [outputs.discard] Wrote batch of 377 metrics in 500ns
2024-03-06T14:45:56Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:56Z D! [outputs.file] Wrote batch of 377 metrics in 5.099417ms
2024-03-06T14:45:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:45:56Z D! [outputs.file] Wrote batch of 377 metrics in 11.822416ms
2024-03-06T14:45:56Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:06Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 2.278917ms
2024-03-06T14:46:06Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:06Z D! [outputs.discard] Wrote batch of 379 metrics in 459ns
2024-03-06T14:46:06Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:06Z D! [outputs.file] Wrote batch of 379 metrics in 6.278666ms
2024-03-06T14:46:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:06Z D! [outputs.file] Wrote batch of 379 metrics in 11.075959ms
2024-03-06T14:46:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:16Z D! [outputs.prometheus_client] Wrote batch of 460 metrics in 2.359ms
2024-03-06T14:46:16Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:16Z D! [outputs.discard] Wrote batch of 460 metrics in 542ns
2024-03-06T14:46:16Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:16Z D! [outputs.file] Wrote batch of 460 metrics in 6.390125ms
2024-03-06T14:46:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:16Z D! [outputs.file] Wrote batch of 460 metrics in 11.311709ms
2024-03-06T14:46:16Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
^C2024-03-06T14:46:23Z D! [agent] Stopping service inputs
2024-03-06T14:46:23Z D! [inputs.gnmi] Connection to gNMI device arista-switch:6030 closed
2024-03-06T14:46:23Z D! [agent] Input channel closed
2024-03-06T14:46:23Z I! [agent] Hang on, flushing any cached metrics before shutdown
2024-03-06T14:46:23Z D! [outputs.discard] Wrote batch of 379 metrics in 667ns
2024-03-06T14:46:23Z D! [outputs.discard] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:23Z D! [outputs.prometheus_client] Wrote batch of 379 metrics in 1.517541ms
2024-03-06T14:46:23Z D! [outputs.prometheus_client] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:23Z D! [outputs.file] Wrote batch of 379 metrics in 4.789541ms
2024-03-06T14:46:23Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:23Z D! [outputs.file] Wrote batch of 379 metrics in 8.526042ms
2024-03-06T14:46:23Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-03-06T14:46:23Z I! [agent] Stopping running outputs
2024-03-06T14:46:23Z D! [agent] Stopped Successfully

System info

Telegraf 1.29.5, MacOS Homebrew

Docker

No response

Steps to reproduce

  1. Start telegraf
  2. Wait for measurements to come in
  3. Check output files and Prometheus endpoint ...

Expected behavior

Measurements have consistent path attributes.

Actual behavior

Measurements sometimes are missing the path attribute. This leads for example to duplicate measurements in the prometheus exporter. The following should be one measurement, not two:

curl -s http://localhost:9273/metrics | grep '^gnmi_sys_cpu_user_min{.*index="2"'
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3

Checking the output file in prometheus format we can see that this changes from time to time for the same measurement:

grep '^gnmi_sys_cpu_user_min{.*index="2"' gnmi.out.prom
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 2
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3
gnmi_sys_cpu_user_min{host="tanagra",index="2",source="arista-switch"} 3

Checking the same metric in the influxdb output file, it seems that the path only get recorded when there are multiple measurements in one update (in this case user/min and user/min_time):

grep '^gnmi_sys_cpu.*index=2,.* user/min='gnmi.out
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=2i 1709733513565521342
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,path=/system/cpus/cpu/state,source=arista-switch user/min=3i,user/min_time=1709735813574488878i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558
gnmi_sys_cpu,host=tanagra,index=2,source=arista-switch user/min=3i 1709736093566217558

Additional info

Testing the same gNMI output from a python script with pygnmi show consistent measurements coming from the switch. The only difference is that updates with multiple measurements have a prefix and relative path while single measurement updates have a full path:

{'update': {'update': [{'path': 'hardware-interrupt/avg', 'val': 0}, {'path': 'hardware-interrupt/instant', 'val': 0}], 'timestamp': 1709191123526498340, 'prefix': 'system/cpus/cpu[index=0]/state'}}
{'update': {'update': [{'path': 'system/cpus/cpu[index=0]/state/hardware-interrupt/interval', 'val': 1000000000000}], 'timestamp': 1709191123934242322}}
sebastianw commented 6 months ago

I just found the dump_responses option for the gnmi plugin and can confirm now that this seems to be a problem with multiple updates.

Checking the output file in prometheus format I see this:

gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.478126592e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.478450176e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.479629824e+09
gnmi_sys_memory_used{host="tanagra",source="arista-switch"} 3.479527424e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.479810048e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.479003136e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.478552576e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.477671936e+09
gnmi_sys_memory_used{host="tanagra",path="/system/memory/state",source="arista-switch"} 3.47871232e+09

This corresponds to this debug output from telegraf:

2024-03-06T15:08:53Z D! [inputs.gnmi] Got update_1709737723565746678: {"update":{"timestamp":"1709737723565746678","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6357975040"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3478126592"}}]}}
2024-03-06T15:09:03Z D! [inputs.gnmi] Got update_1709737733566450753: {"update":{"timestamp":"1709737733566450753","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6358298624"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3478450176"}}]}}
2024-03-06T15:09:13Z D! [inputs.gnmi] Got update_1709737743568119333: {"update":{"timestamp":"1709737743568119333","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6359478272"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3479629824"}}]}}
2024-03-06T15:09:23Z D! [inputs.gnmi] Got update_1709737753565697718: {"update":{"timestamp":"1709737753565697718","update":[{"path":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"},{"name":"used"}]},"val":{"uintVal":"3479527424"}}]}}
2024-03-06T15:09:33Z D! [inputs.gnmi] Got update_1709737763565722269: {"update":{"timestamp":"1709737763565722269","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6359670784"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3479810048"}}]}}
2024-03-06T15:09:43Z D! [inputs.gnmi] Got update_1709737773566721549: {"update":{"timestamp":"1709737773566721549","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6358863872"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3479003136"}}]}}
2024-03-06T15:09:53Z D! [inputs.gnmi] Got update_1709737783565848683: {"update":{"timestamp":"1709737783565848683","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6358413312"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3478552576"}}]}}
2024-03-06T15:10:03Z D! [inputs.gnmi] Got update_1709737793566147217: {"update":{"timestamp":"1709737793566147217","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6357532672"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3477671936"}}]}}
2024-03-06T15:10:13Z D! [inputs.gnmi] Got update_1709737803565776294: {"update":{"timestamp":"1709737803565776294","prefix":{"elem":[{"name":"system"},{"name":"memory"},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"reserved"}]},"val":{"uintVal":"6358564864"}},{"path":{"elem":[{"name":"used"}]},"val":{"uintVal":"3478712320"}}]}}
srebhan commented 6 months ago

@sebastianw thanks for the debugging effort, I will take a look this week...

srebhan commented 6 months ago

@sebastianw can you please add

  guess_path_tag = true

to your [[inputs.gnmi]] section (not to the subscriptions) and check if this fixes the issue!?

sebastianw commented 6 months ago

@srebhan

It does not fix the issue, now I see two different paths instead of one with path and one without. Again an example, this should be one measurement:

curl -s http://localhost:9273/metrics | grep '^gnmi_sys_cpu_hardware_interrupt_min_time{.*index="ALL"' 
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="ALL",path="/system/cpus/cpu/state",source="arista-switch"} 1.7098053835690132e+18
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="ALL",path="/system/cpus/cpu/state/hardware-interrupt",source="arista-switch"} 1.709805483568305e+18

And here are two of the measurements from the telegraf dump log:

2024-03-07T09:55:41Z D! [inputs.gnmi] Got update_1709805333566280930: {"update":{"timestamp":"1709805333566280930","update":[{"path":{"elem":[{"name":"system"},{"name":"cpus"},{"name":"cpu","key":{"index":"ALL"}},{"name":"state"},{"name":"hardware-interrupt"},{"name":"min-time"}]},"val":{"uintVal":"1709805333568034887"}}]}}
2024-03-07T09:55:51Z D! [inputs.gnmi] Got update_1709805343565718902: {"update":{"timestamp":"1709805343565718902","prefix":{"elem":[{"name":"system"},{"name":"cpus"},{"name":"cpu","key":{"index":"ALL"}},{"name":"state"}]},"update":[{"path":{"elem":[{"name":"hardware-interrupt"},{"name":"min-time"}]},"val":{"uintVal":"1709805343567684412"}},{"path":{"elem":[{"name":"idle"},{"name":"avg"}]},"val":{"uintVal":"89"}},{"path":{"elem":[{"name":"idle"},{"name":"instant"}]},"val":{"uintVal":"90"}}]}}
srebhan commented 6 months ago

@sebastianw Telegraf cannot know that this should be one measurement. Look at the data you receive from your device:

The first line has one element

prefix: 
path: /system/cpus/cpu/state/hardware-interrupt/min-time
value: 1709805333568034887

while the second one has three elements

prefix: /system/cpus/cpu/state
path: hardware-interrupt/min-time
value: 1709805343567684412

and

prefix: /system/cpus/cpu/state
path: idle/avg
value: 89

and

prefix: /system/cpus/cpu/state
path: idle/instant
value: 90

For the path we usually use the prefix element but as you can see your first data-point doesn't have that. We have no information on what part of the path the "prefix" is, so we have to guess the "common" part by leaving our the last path element. For the other three elements of the second update we get an explicit information about the "common" part in the prefix...

The only way would be to get an information on what the common part is. I guess you want the "subscription" path. Is this correct?

srebhan commented 6 months ago

@sebastianw can you please test the binary in #14951 available once CI finished the tests successfully!? Please use

[[inputs.gnmi]]
  addresses = ["arista-switch:6030"]
  username = "HIDDEN"
  password = "HIDDEN"
  redial = "60s"
  tls_enable = true
  insecure_skip_verify = true
  path_guessing_strategy = "subscription"

  [[inputs.gnmi.subscription]]
    ...

in your config to use the subscription path as path tag if it is missing. Let me know if this fixes your issue!

sebastianw commented 6 months ago

@srebhan This is a standard Arista gNMI export. As I see it the "full path" in the two updates is the same for my measurement in question:

First update:

prefix("") + path("/system/cpus/cpu/state/hardware-interrupt/min-time") = /system/cpus/cpu/state/hardware-interrupt/min-time

Second update:

prefix("/system/cpus/cpu/state") + path("hardware-interrupt/min-time") = /system/cpus/cpu/state/hardware-interrupt/min-time

Plus the two additional measurements in the second update:

prefix("/system/cpus/cpu/state") + path("idle/avg") = /system/cpus/cpu/state/idle/avg
prefix("/system/cpus/cpu/state") + path("idle/instant") = /system/cpus/cpu/state/idle/instant

So I would think the path tag is always the "full" path, in this case these three for the different measurements:

/system/cpus/cpu/state/hardware-interrupt/min-time
/system/cpus/cpu/state/idle/avg
/system/cpus/cpu/state/idle/instant
srebhan commented 6 months ago

@sebastianw this might be true for prometheus outputs, but other outputs support multiple fields per metric (e.g. InfluxDB) so the path cannot be full. You can use the canonical_field_names option to get the full path as field names if this is what you are after.

sebastianw commented 6 months ago

@sebastianw can you please test the binary in #14951 available once CI finished the tests successfully!?

@srebhan I just tested this and with path_guessing_strategy = "subscription" in the config the problem seems indeed to be gone. I now get full paths all the time:

curl -s http://localhost:9273/metrics | grep '^gnmi_sys_cpu_hardware_interrupt_min_time{.*' 
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="0",path="/system/cpus/cpu/state",source="arista-switch"} 1.709815703566674e+18
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="1",path="/system/cpus/cpu/state",source="arista-switch"} 1.70981570356715e+18
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="2",path="/system/cpus/cpu/state",source="arista-switch"} 1.7098157035676063e+18
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="3",path="/system/cpus/cpu/state",source="arista-switch"} 1.7098157035680916e+18
gnmi_sys_cpu_hardware_interrupt_min_time{host="tanagra",index="ALL",path="/system/cpus/cpu/state",source="arista-switch"} 1.7098157035685952e+18

I also tested with canonical_field_names enabled, but that gives me no metrics at all, only errors like these:

2024-03-07T12:44:38Z E! [inputs.gnmi] Invalid empty path "/system/memory/state/reserved" with alias "/system/memory/state"
2024-03-07T12:44:38Z E! [inputs.gnmi] Invalid empty path "/system/memory/state/used" with alias "/system/memory/state"

So it seems your fix works, even though I don't think I understand the logic completely tbh. :)

sebastianw commented 6 months ago

@srebhan Okay I think I got it now, the measurement "name" (For example gnmi_sys_cpu_idle_avg for Prometheus and gnmi_sys_cpu,... idle/avg=90i for InfluxDB) was always the "subscription name" as prefix and the full path minus the subscription path as suffix for Prometheus and measurement name for InfluxDB. Only difference with the new option now is that the path tag is filled with the subscription path?

sebastianw commented 6 months ago

I looked at the gNMI specification for Paths and it seems Arista is using it in the expected way.

In a number of messages, a prefix can be specified to reduce the lengths of path fields within the message. In this case, a prefix field is specified within a message - comprising of a valid path encoded according to Section 2.2.2. In the case that a prefix is specified, the absolute path is comprised of the concatenation of the list of path elements representing the prefix and the list of path elements in the path field.

So the prefix is there to reduce message length and I think from a gNMI standpoint a measurement is unique by the full path (optional prefix + path elements). If we were only interested in Prometheus I would suggest putting this full path in the path tag but as you already said this would mess up InfluxDB and maybe other formats.

I wonder if there is a way (and value) to preserve the full path for Prometheus instead of just the subscription path, but at least for our specific application the proposed fix works fine.

srebhan commented 6 months ago

@sebastianw thanks for testing! Regarding the logic: With the new option the path is set to the prefix of the message if it exists, otherwise it will use the subscription path (with the option you set).

The issue is not that the path is invalid, it's only that it's not consistent across updates. It was a bad choice to add the path tag at all I think, but that's a totally different thing...

For the invalid canonical field names error here I would love to get a response dump of one or two failing messages...

srebhan commented 6 months ago

@sebastianw it would be nice if you could also test #14953 for the canonical-field-names. Please note, the PR there will not provide the paths until both PRs are merged...

sebastianw commented 6 months ago

@srebhan The canonical field name setting made all messages fail, I had 0 measurements so you could test with any of the messages from the dumps posted in this issue. If you need more let me know. With the binary from #14953 I get measurements with names like gnmi_sys_cpu__system_cpus_cpu_state_wait_avg and no failures.

Regarding the path tag, I wouldn't mind dropping it completely (maybe via a config option) in the input plugin. We tried to do that anyway in Prometheus post-processing but this confuses Prometheus when we have two measurements that only differ in the path name and clash after removal of the path (hence this issue here).

srebhan commented 6 months ago

Ok, so to summarize, the first PR fixes the path tag issue and you were able confirm this. The second PR fixes the canonical_field_names issue and you were able to confirm this.

Thanks for testing!

What you can do is to use canonical-field-names, drop the path tag via tagexclude (see metric filtering) and then use the regex processor to construct the metric and field names as you need them...