influxdata/telegraf

Feature request for mqtt_consumer: ignore retained messages

Open

#10.824 aperta il 16 mar 2022

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Go (4161 fork)batch import
area/mqttfeature requesthelp wantedsize/l

Metriche repository

Star
 (9892 star)
Metriche merge PR
 (Merge medio 2g 12h) (136 PR mergiate in 30 g)

Descrizione

Feature Request

When using the MQTT consumer input plugin, you can subscribe to topics that have a retained value. At the moment, retained messages are treated as any other message and their value it stored.

Proposal:

Add a configuration setting to allow the mqtt_consumer input plugin to ignore retained messages.

Current behavior:

  1. Telegraf starts
  2. mqtt_consumer subscribes to configured topics
  3. Broker sends the retained messages for the configured topics
  4. Telegraf stores the values in configures output.

Desired behavior:

  1. Telegraf starts
  2. mqtt_consumer subscribes to configured topics
  3. Broker sends the retained messages for the configured topics
  4. Telegraf checks the config for the plugin, and if the option to ignore retained messages is set, it will NOT store the retained values.

Use case:

I have sensors that publish their data to MQTT with the retain flag set. Currently, every time I restart telegraf, it stores the retained value again when I only want it to update when new messages arrive.

Guida contributor