openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
166 stars 52 forks source link

split-events: false not suppressing empty messages #472

Open zenodhaene opened 2 weeks ago

zenodhaene commented 2 weeks ago

I'm experimenting with the "event-drop" filter, and I'm wondering whether the following is intended behavior:

When the event-drop filter rejects all events in a message, the content of the message is None.

My configuration:

...
targets:
  srl-1:57400:
    subscriptions:
      - srl_name

subscriptions:
  srl_name:
    paths:
      - /system/name/host-name
    mode: stream
    stream-mode: sample
    sample-interval: 5s

outputs:
  kafka-output:
    type: kafka
    address: <redacted>:9092
    topic: testtoppic
    max-retry: 2
    timeout: 5s
    recovery-wait-time: 10s
    format: event
    override-timestamps: false
    buffer-size: 0
    enable-metrics: true
    debug: true
    split-events: true
    event-processors:
      - drop-empty

processors:
  drop-empty:
    event-drop:
      tags:
      - ".*"

Example message when split-events: false is configured: image

Is there any way to achieve the same behavior when split-events: false is configured? I.e., no message is sent if all messages are filtered out?

karimra commented 1 week ago

There is no way to suppress the empty list of events using processors, I added that behavior in #473

zenodhaene commented 1 week ago

Thanks @karimra for the very speedy implementation! I tested it, and it works as expected.

When can we expect this feature to be released in the official image?

karimra commented 4 days ago

Hey Zeno, v0.38.0 should have the fix. Thanks for reporting this!