You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrade prometheus/common to v0.67.5 and use NewTextParser
In v0.67.5 the zero-value TextParser panics because the ValidationScheme
enum was reordered: UnsetValidation=0 (new), LegacyValidation=1,
UTF8Validation=2. The TextParser.scheme field defaults to zero which now
maps to UnsetValidation and panics in IsValidMetricName.
Use expfmt.NewTextParser(model.LegacyValidation) to explicitly initialize
the parser with the correct validation scheme. Add comprehensive test
coverage for all prometheus metric types (counter, gauge, histogram,
summary), multiple metric families, malformed input, empty output, NaN
handling, and special character labels.
Signed-off-by: Sarvodaya Kumar <sarvodaya.kumar.ctr@sumologic.com>
Output: "# HELP node_filesystem_avail_bytes Filesystem space available.\n# TYPE node_filesystem_avail_bytes gauge\nnode_filesystem_avail_bytes{device=\"/dev/sda1\",mountpoint=\"/\"} 5.3687091e+10\n",
Output: "# HELP node_cpu_seconds_total Seconds the CPUs spent in each mode.\n# TYPE node_cpu_seconds_total counter\nnode_cpu_seconds_total{cpu=\"0\",mode=\"idle\"} 123456.78\nnode_cpu_seconds_total{cpu=\"0\",mode=\"system\"} 4567.89\n# HELP node_load1 1m load average.\n# TYPE node_load1 gauge\nnode_load1 2.34\n",
event.Check.Output="# HELP http_requests_total The total number of HTTP requests.\n# TYPE http_requests_total counter\nhttp_requests_total{method=\"post\",code=\"200\"} 1027\nhttp_requests_total{method=\"post\",code=\"400\"} 3\n"
event.Check.Output="# HELP node_memory_MemAvailable_bytes Memory information field MemAvailable_bytes.\n# TYPE node_memory_MemAvailable_bytes gauge\nnode_memory_MemAvailable_bytes 5.361664e+09\n"
event.Check.Output="# HELP http_request_duration_seconds A histogram of the request duration.\n# TYPE http_request_duration_seconds histogram\nhttp_request_duration_seconds_bucket{le=\"0.05\"} 24054\nhttp_request_duration_seconds_bucket{le=\"0.1\"} 33444\nhttp_request_duration_seconds_bucket{le=\"0.2\"} 100392\nhttp_request_duration_seconds_bucket{le=\"+Inf\"} 144320\nhttp_request_duration_seconds_sum 53423\nhttp_request_duration_seconds_count 144320\n"
event.Check.Output="# HELP go_gc_duration_seconds A summary of pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 3.3722e-05\ngo_gc_duration_seconds{quantile=\"0.25\"} 5.0129e-05\ngo_gc_duration_seconds{quantile=\"0.5\"} 0.000126547\ngo_gc_duration_seconds{quantile=\"1\"} 0.009688629\ngo_gc_duration_seconds_sum 17.391350544\ngo_gc_duration_seconds_count 12345\n"
event.Check.Output="# HELP node_filesystem_avail_bytes Filesystem space available.\n# TYPE node_filesystem_avail_bytes gauge\nnode_filesystem_avail_bytes{device=\"/dev/sda1\",mountpoint=\"/\"} 5.3687091e+10\n# HELP node_filesystem_size_bytes Filesystem size in bytes.\n# TYPE node_filesystem_size_bytes gauge\nnode_filesystem_size_bytes{device=\"/dev/sda1\",mountpoint=\"/\"} 1.03079215104e+11\n# HELP node_cpu_seconds_total Seconds the CPUs spent in each mode.\n# TYPE node_cpu_seconds_total counter\nnode_cpu_seconds_total{cpu=\"0\",mode=\"idle\"} 123456.78\nnode_cpu_seconds_total{cpu=\"0\",mode=\"system\"} 4567.89\n"
0 commit comments