im using kafka to publish 1000 messages to telegraf which in turn writes to influx.
Influx measurement count shows only 529 data points in cli for query
(select count(*) from <meas_name> )
telegraf config is this :
[agent]
## Default data collection interval for all inputs
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = true
# quiet = false
logtarget = "file"
logfile = "/home/telegraf/telegraf.log"
logfile_rotation_interval = "2d"
logfile_rotation_max_size = "50MB"
logfile_rotation_max_archives = 50
# log_with_timezone = ""
hostname = ""
## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = false
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "V645342442sfsfsdfR-kky6zA_zOnJOoUdIaeBYWG3dXlkXobfNRDSJQNq33Lnk_K3lYopn3duu9OWSwweNlA9ADDw=="
organization = "qwerty"
bucket = "BUCK1"
# Read metrics from Kafka topics
[[inputs.kafka_consumer]]
## Kafka brokers.
brokers = ["localhost:9092"]
## Topics to consume.
topics = ["TOPIC_TEST1", "TOPIC_TEST2"]
sasl_username = "admin"
sasl_password = "admin"
sasl_mechanism = "PLAIN"
max_message_len = 1000000
data_format = "json"
json_name_key = "msgId"
tag_keys = ["gwId","deviceId","category","uid"]
json_time_key = "srcTimestamp"
json_time_format = "unix_ms"
telegraf logs do show 200 + 800 (1000) writes.
but for that particular msgId in influxdb the total count of messages is in the range of 520-530.
the influx logs show no sign of any errors.
the message published from kafka is -
{âmsgIdâ:â76543â,âgwIdâ:âEA0G0018â,âdeviceIdâ:âED401A0D0000089â,âcategoryâ:âTELEMETRYâ,âuidâ:âED401A0D0000089-90007-1â,âtemperatureâ:999,âsrcTimestampâ:1724338050166}
temperature value ranging from 0-999 (just testing)
Any help is appreciated. am i missing some config in telegraf? or can is there any optimization required?