[Telegraf JTI Openconfig Inputs] Is this plugin support listener mode?

Hi everyone,

I want to use Telegraf JTI Openconfig Inputs (docs: telegraf/README.md at release-1.26 · influxdata/telegraf · GitHub) to collect and monitor network device.
As configuration in the documentation, I think this plugin only supports the poll model, which means Telegraf will scrape metrics from the network device.

# Subscribe and receive OpenConfig Telemetry data using JTI
[[inputs.jti_openconfig_telemetry]]
  ## List of device addresses to collect telemetry from
  servers = ["localhost:1883"]

But, as the JTI documentation (Overview of the Junos Telemetry Interface | Junos OS | Juniper Networks), network devices will push telemetry to the collector(such as Telegraf).
So, does Telegraf JTI Openconfig Inputs support a listener mode that receives metrics from network devices?

When the JTI plugin starts up it subscribes to the various sensor path’s and then sits and waits for data to come in, partially based on the sample frequency used. So it does somewhat listen, but needs to know who to listen to.

The plugin however is not a generic enough listener, where it could start up and just wait for metrics to come in from random sources.

So, as I understand, we need to define all network devices that need to monitor.
And then Telegraf will subscribe and wait for metrics sent from those network devices (Telegraf does not scrape metrics only subscribe and wait).
But, I think it has the drawback that we have to define all network devices, for example: 100 devices = 100 device addresses.

That is correct.

What methods and protocols to these devices have to send metrics? Do they all send the same type of data?

What methods and protocols to these devices have to send metrics?

I open grpc in the Juniper network device.

[[inputs.jti_openconfig_telemetry]]
  ## List of device addresses to collect telemetry from
  servers = ["10.116.0.50:50051"]

  ## Authentication details. Username and password are must if device expects
  ## authentication. Client ID must be unique when connecting from multiple instances
  ## of telegraf to the same device
  #username = "user"
  #password = "pass"
  #client_id = "telegraf"

  ## Frequency to get data
  sample_frequency = "1000ms"
  sensors = [
     "/junos/system/linecard/interface/",
  ]
  ## Delay between retry attempts of failed RPC calls or streams. Defaults to 1000ms.
  ## Failed streams/calls will not be retried if 0 is provided
  retry_delay = "1000ms"

  ## To treat all string values as tags, set this to true
  str_as_tags = false

I am testing with this config and received the error:

2023-04-22T08:45:00Z D! [inputs.jti_openconfig_telemetry] Received from 10.116.0.50: 
2023-04-22T08:45:00Z D! [inputs.jti_openconfig_telemetry] Available collection for 10.116.0.50 is: []
2023-04-22T08:45:00Z E! [inputs.jti_openconfig_telemetry] Error in plugin: failed to read from 10.116.0.50: rpc error: code = Unavailable desc = JGrpcServer: Unknown RPC /telemetry.OpenConfigTelemetry/telemetrySubscribe received
^C2023-04-22T08:45:00Z D! [agent] Stopping service inputs
2023-04-22T08:45:00Z E! [inputs.jti_openconfig_telemetry] Error in plugin: failed to read from 10.116.0.50: rpc error: code = Canceled desc = grpc: the client connection is closing
2023-04-22T08:45:00Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to 10.116.0.50: rpc error: code = Canceled desc = grpc: the client connection is closing

Could you share with me some ideal about this error?

Sounds like the device you are trying to connect to does not have anything to subscribe to or is not supported. I did see this error message Jti_openconfig_telemetry Unknown RPC received · Issue #8963 · influxdata/telegraf · GitHub before where a user was trying to use an unsupported device.

We are using network device: EX4300.
I think I will try to ensure that the device is export metric to clarify whether the device or Telegraf has a connection issue.