influxdata / telegraf

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

inputs.gnmi fails when metric-name is empty #14063

Closed whizkidTRW closed 1 year ago

whizkidTRW commented 1 year ago

Relevant telegraf.conf

# Ciena gNMI
[agent]
  interval = "5m"

[[inputs.gnmi]]
  alias = "ciena-gnmi"
  addresses = ["10.144.248.3:6702"]
  username = "XXXXXXXXXXXXXXXXXXXX"
  password = "XXXXXXXXXXXXXXXXXXXX"
  encoding = "proto"
  redial = "10s"
  enable_tls = true
  insecure_skip_verify = true
  tls_ca = "/etc/telegraf/ciena-ca.cert.pem"
  tls_cert = "/etc/telegraf/ciena-client.cert.pem"
  tls_key = "/etc/telegraf/ciena-client.key.pem"
  name_override = "saos10xgnmi"
  updates_only = true

  fieldpass = ["path","source",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/in_crc_error_pkts",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/in_discards",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/in_errors",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/in_octets",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/name",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/out_errors",
               "Ciena:/oc_if:interfaces/oc_if:interface/oc_if:state/oc_if:countersCiena:/out_octets"]

  tagexclude = ["path","name"]

  [[inputs.gnmi.subscription]]
     name = "ifcounters"
     origin = "openconfig-interfaces"
     path = "/oc-if:interfaces/oc-if:interface/oc-if:state/oc-if:counters"
     subscription_mode = "sample"
     sample_interval = "30s"

Logs from Telegraf

telegraf  | 2023-10-06T18:41:35Z W! [inputs.gnmi::ciena-gnmi] Got empty metric-name for response, usually indicating
telegraf  | configuration issues as the response cannot be related to any subscription.
telegraf  | Please open an issue on https://github.com/influxdata/telegraf including your
telegraf  | device model and the following response data:
telegraf  | timestamp:1696617695101000000 prefix:{origin:"Ciena" elem:{name:"oc-if:interfaces"} elem:{name:"oc-if:interface"} elem:{name:"oc-if:state"} elem:{name:"oc-if:counters"}} update:{path:{origin:"Ciena" elem:{name:"in-1024-to-1518-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-128-to-255-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-1519-to-2047-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-2048-to-4095-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-256-to-511-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-4096-to-9216-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-512-to-1023-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-64-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-65-to-127-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-broadcast-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-crc-error-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-discards"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-discards-octets"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-dropped-octets"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-dropped-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-errors"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-jabber-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-multicast-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-octets"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-oversize-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-undersize-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"in-unicast-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"last-clear"}} val:{uint_val:1691859140059797458}} update:{path:{origin:"Ciena" elem:{name:"link-flap-events"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"name"}} val:{string_val:"\"1\""}} update:{path:{origin:"Ciena" elem:{name:"out-1519-to-2047-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-2048-to-4095-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-4096-to-9216-octet-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-broadcast-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-errors"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-multicast-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-octets"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-pkts"}} val:{uint_val:0}} update:{path:{origin:"Ciena" elem:{name:"out-unicast-pkts"}} val:{uint_val:0}}
telegraf  | This message is only printed once.

System info

Telegraf 1.28.2, Debian 11, Docker 20.10.5

Docker

No response

Steps to reproduce

  1. Run under telegraf > 1.26.2
  2. Any Ciena router (SAOS 10.8) fails
  3. ...

Expected behavior

It was working fine under 1.26.2 once this message was made a warning (instead of an error). But, now anything newer than 1.26.2 fails.

Actual behavior

The data just isn't output, presumable because it isn't parseable. Removing the origin parameter in the config yields the erorr message but still no data output.

Additional info

I've opened a previous issue on this and it was fixed in 1.25 but now it's broken again . . .

whizkidTRW commented 1 year ago

FWIW, here's what the interfaces "sensor" looks like in the Ciena SAOS 10.8 UI, along with the existing subscription (that is currently working" to our production Telegraf 1.26.1 instance:

+-------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 11    |   Sensor Path Name  | /oc-if:interfaces/oc-if:interface/oc-if:state/oc-if:counters                                                                                                                      |
|       |   Sensor Sub Mode   | sample                                                                                                                                                                            |
|       |   Sensor ID         | 3071242026345933326                                                                                                                                                               |
+-------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------+---------------------------------+----------------------------------------------------------------------------------------------------------+
| 2     | Subscription:                   |                                                                                                          |
|       |   Subscription-ID               | bc8795b3-b373-4c34-b9c3-234b73a33153                                                                     |
|       |   Subscription State            |                                                                                                          |
|       |     User Name                   | XXXXXXXXXXXXXXXX                                                                                         |
|       |     Subscription Mode           | stream                                                                                                   |
|       |     Update Only                 | True                                                                                                     |
|       |     Sample Interval             | 30000000000                                                                                              |
|       |   Subscription Message          |                                                                                                          |
|       |     Telemetry Sensor Paths      |                                                                                                          |
|       |       Telemetry Sensor Path     | /oc-if:interfaces/oc-if:interface/oc-if:state/oc-if:counters                                             |
|       |       Telemetry Sensor ID       | 6958060735294400085                                                                                      |
|       |       Telemetry Sensor Sub-Mode | sample                                                                                                   |
|       |       Telemetry Sensor Svc-Mode | sample                                                                                                   |
+-------+---------------------------------+----------------------------------------------------------------------------------------------------------+
srebhan commented 1 year ago

@whizkidTRW can you please test the binary in PR #14091 and let me know if that fixes your issue!?