Prometheus input text format parsing error

I’m trying to use the Prometheus input plugin with an HTTP endpoint that looks like this:

# HELP qsys_chassis_temperature The current temperature, in Celsius, of the Core chassis.
# TYPE qsys_chassis_temperature gauge
qsys_chassis_temperature 34.0
# HELP qsys_core_status Number from 0 to 5. O=OK, 1=compromised, 2=fault, 3=not present, 4=missing, 5=initializing
# TYPE qsys_core_status gauge
qsys_core_status 0
# HELP qsys_core_info A metric with a constant '1' value with labels for textual data. Grandmaster is either Core name or the PTP Clock GUID
# TYPE qsys_core_info gauge
qsys_core_info{ptp_grandmaster="00-60-74-ff-fe-fb-99-de" ptp_parent_port="" version="9.9.0-2308.008" platform="Core Nano" design_code="PDS2q1XZrzuO" design_name="The Jar"} 1

I’m getting this error:

 $ telegraf --config telegraf_debug.conf --test --input-filter prometheus
2024-01-20T01:59:03Z I! Loading config: telegraf_debug.conf
2024-01-20T01:59:03Z E! [inputs.prometheus] Error in plugin: error reading metrics for "http://10.37.163.133:10006/metrics": reading text format failed: text format parsing error in line 9: unexpected end of label value "00-60-74-ff-fe-fb-99-de"
2024-01-20T01:59:03Z E! [telegraf] Error running agent: input plugins recorded 1 errors

I’m using Telegraf 1.29.2 with this config:

[[inputs.prometheus]]
  urls = ["http://10.37.163.133:10006/metrics"]
  metric_version = 2

I figured it out! The Prometheus format technically requires commas separating each label. I never noticed this because Prometheus handles this bad syntax with no error. So I’ll fix it on the exporter side.

Hello @llamafilm
Thank you for sharing your solution with the community! It’s much appreciated.