Hello,
I am trying to collect data from Kafka (from a SAN-Switch) using telegrafs [[inputs.kafka_consumer]].
The Kafka-producer uses the avro-format when putting the data into Kafka (which I can not change).
Here is the relevant part of telegraf.conf
[[inputs.kafka_consumer]]
brokers = ["<hostname>:9093"]
topics = ["perfmon_metrics_switch"]
version = "7.3.3"
insecure_skip_verify = true
max_message_len = 1000000
data_format = "avro"
avro_schema = '''
{
"namespace": "com.brocade.streaming",
"name": "fibrechannel_switch_statistics",
"type": "record",
"version": "1",
"fields": [
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
{"name": "cpu_utilization", "type": "float", "default": 0, "doc": "CPU Utilization in %"},
{"name": "memory_utilization", "type": "float", "default": 0, "doc": "Memory Utilization in %"}
]
}
'''
avro_measurement = "Switch"
avro_tags = ["switch_wwn"]
avro_fields = ["up_time", "cpu_utilization", "memory_utilization"]
avro_timestamp = "statistics_collection_time"
avro_timestamp_format = "unix_ms"
[[outputs.file]]
files = ["stdout", "/tmp/metrics.out"]
data_format = "influx"
The “raw” data read with kafka-avro-console-consumer looks like this:
{"switch_wwn":"10:00:50:EB:1A:0B:84:3A","statistics_collection_time":1682509200092,"up_time":1166984904,"cpu_utilization":14.0,"memory_utilization":20.0}
{"switch_wwn":"10:00:D8:1F:CC:5B:3E:77","statistics_collection_time":1682509200224,"up_time":164446104,"cpu_utilization":4.0,"memory_utilization":10.0}
I am expecting to get the following output:
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A up_time=1166984904,cpu_utilization=14.0,memory_utilization=20.0 1682509200092000
Switch,switch_wwn=10:00:D8:1F:CC:5B:3E:77 up_time=164446104,cpu_utilization=4.0,memory_utilization=10.0 1682509200224000
But, what I get is something like the following:
Switch cpu_utilization=0.0000000025322037799924146,memory_utilization=0.0000000006411111641568823,statistics_collection_time=0i,up_time=0i 0
Switch memory_utilization=0.0000000006411111641568823,statistics_collection_time=0i,up_time=0i,cpu_utilization=0.0000000025322037799924146 0
Switch up_time=0i,cpu_utilization=0.0000000025322037799924146,memory_utilization=0.0000000006411111641568823,statistics_collection_time=0i 0
Switch statistics_collection_time=0i,up_time=0i,cpu_utilization=0.0000000025322037799924146,memory_utilization=0.0000000006411111641568823 0
Switch up_time=0i,cpu_utilization=0.0000000025322037799924146,memory_utilization=0.0000000006411111641568823,statistics_collection_time=0i 0
Switch statistics_collection_time=0i,up_time=0i,cpu_utilization=0.0000000025322037799924146,memory_utilization=0.0000000006411111641568823 0
Some version information:
OS: AlmaLinux release 8.7 (Stone Smilodon)
Telegraf: 1.26.1 (git: HEAD@8f421f25)
Kafka: Confluent Kafka 7.3.3-ccs (Commit:37ce202868a57983d7f28fdeb51e9147ba8e3f95)
Any Idea what I am doing wrong and what I can do to correct it?
Regards,
Dan