Telegraf missing data

Hello,

I’m comparing data collected directly from my MQTT device and the same data from an OPC UA server using the same MQTT subscription and broker. Comparing the data sources, using UaExpert (OPC UA Client) and MQTT explorer, both update at the same time (roughly 2 data points per second) and with no missed data.

However, when using telegraf to capture both streams simultaneously and plotting side-by-side, this seems to produce different results?

telegraf.conf

[global_tags]

[agent]
  interval = "100ms"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  hostname = ""
  omit_hostname = false

[[outputs.influxdb_v2]]
  urls = ["http://${DOCKER_INFLUXDB_INIT_HOST}:8086"]
  token = "$DOCKER_INFLUXDB_INIT_ADMIN_TOKEN"
  organization = "$DOCKER_INFLUXDB_INIT_ORG"
  bucket = "$DOCKER_INFLUXDB_INIT_BUCKET"
  insecure_skip_verify = false

[[inputs.opcua]]
    name = "opcua-server"
    endpoint = "opc.tcp://opcua-server:4840"
    connect_timeout = "20s"
    request_timeout = "20s"
    security_policy = "None"
    security_mode = "None"
    auth_method = "Anonymous"

   [[inputs.opcua.group]]
    name = "knauer_p2.1"
    namespace = "2"
    identifier_type = "i"
    nodes = [
     {name="pressure", identifier="8", tags=[["device_num", "1"]]},
     {name="set_point", identifier="9", tags=[["device_num", "1"]]},
   ]
   [[inputs.opcua.group]]
    name = "knauer_p10"
    namespace = "2"
    identifier_type = "i"
    nodes = [
     {name="pressure", identifier="13", tags=[["device_num", "1"]]},
     {name="set_point", identifier="14", tags=[["device_num", "1"]]},
   ]
   [[inputs.opcua.group]]
    name = "polar_bear"
    namespace = "2"
    identifier_type = "i"
    nodes = [
     {name="temperature", identifier="3", tags=[["device_num", "1"]]},
     {name="set_point", identifier="4", tags=[["device_num", "1"]]},
   ]   

[[inputs.mqtt_consumer]]

  servers = ["tcp://mosquitto:1883"]
  topics = [
    "device/#"
  ]
  data_format = "value"
  data_type = "float"

Additionally the speed of plotting is roughly every 3s rather than the selected 1s - Is this difference in speed and accuracy because telegraf is polling at a maximium of 1s for both sources rather than subscribing so is missing data becuase of this poll rate? - does QoS have any impact in telegraf if its polling rather than subscribing?

Thanks!

@om327,
My answer is the same––unfortunately there isnt a way to autorefresh any faster than 1s.

@Jay_Clifford
Looks like this is the similar question with more detail.

Hi @om327,
You are correct! The OPC UA plugin needs quite a bit of love. The first major task is adding subscriptions rather than just polling as you said. I am going to link this feed within the git issue for this: OPC-UA input plugin roadmap · Issue #10062 · influxdata/telegraf · GitHub

1 Like