gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

gnmic-relay: nats to influxdb configuration issues

Open smalenfant opened this issue 1 year ago • 1 comments

I'm getting some strange results (or no results) when attempting to use a gnmic relay with nats. Are there limitation of event processing that can be done when using nats output/input? Are there limitation of outputs that can be used when using nats as an input?

First config, connect to targets and post messages into nats.

targets:
  - ...

subscriptions:
  interfaces:
    paths:
      - /interfaces/interface[name=et-1/0/7]
      #- /interfaces/interface[name=et*]
    mode: STREAM
    stream-mode: sample
    sample-interval: 10s

outputs:
  nats-output:
    type: nats
    address: nats:4222
    subject: telemetry

At this point, I know messages are in nats. When I'm trying to output the results of the relay on the screen, nothing shows up. Noticed that I put the "outputs" on the nats-input plugin (as the document says). But I believe this doesn't work.

inputs:
  nats-input:
    type: nats
    # debug: true
    # format: event
    address: localhost:4222
    subject: telemetry
    outputs:
      - processed
outputs:
  processed:
    type: file
    file-type: stdout
    format: event
    debug: true

I decided to add InfluxDB to the above configuration:

  influx-output:
    type: influxdb
    bucket: telemetry
    url: ...

With the above and removing "outputs" from the "nats-input", it does push the messages into InfluxDB.

Some notes:

  • I can't "event-merge" messages with InfluxDB event-processors. I have to add it to "nats-input".
  • And the rest of my processors work under InfluxDB

To reproduce easily, looks like I should be bringing up containerlab.

smalenfant avatar Jun 21 '23 22:06 smalenfant

Yes the limitation is with formats. File output does not support wiritng received event messages, only proto messages that it converts to event. For the processor, note that event-merge can only merge notifications received as part of the same subscribe response. To merge notifications received separately, you will have to use a cache. PS: I'm on PTO with limited access to a laptop for the rest of this week, I will be able to help a bit more starting next week.

karimra avatar Jun 22 '23 08:06 karimra