Skip to content

fix: kafka output error metric missing label#724

Merged
karimra merged 3 commits intoopenconfig:mainfrom
senthilsam:fix/kafak_metrics
Sep 14, 2025
Merged

fix: kafka output error metric missing label#724
karimra merged 3 commits intoopenconfig:mainfrom
senthilsam:fix/kafak_metrics

Conversation

@senthilsam
Copy link
Contributor

this inconsistency in labels leads to panics, so simply hacking them with a reason as unknown where we can't get reason

2025/09/06 00:40:02.642215 [gnmic] target "xxxxxxx": subscription test-sample rcv error: failed to create a subscribe client, target='xxxxxxx', retry in 10000000000. err=rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp xxxx:9339: connect: no route to host"
panic: inconsistent label cardinality: expected 3 label values but got 2 in []string{"kafka-kafka-prod", "timeout"}

goroutine 2258 [running]:
github.com/prometheus/client_golang/prometheus.(*CounterVec).WithLabelValues(0x4001489ea8?, {0x4001489ed8?, 0x12a05f200?, 0x1?})
	/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/counter.go:284 +0x68
github.com/openconfig/gnmic/pkg/outputs/kafka_output.(*kafkaOutput).Write(0x400061c620, {0x4303d98, 0x400079f5e0}, {0x42c6ba0, 0x4003de8d70}, 0x4001c30900)

@senthilsam senthilsam changed the title fix missing error label fix: kafka output error metric missing label Sep 11, 2025
@senthilsam senthilsam requested a review from karimra September 13, 2025 02:26
@senthilsam senthilsam requested a review from karimra September 14, 2025 04:59
Copy link
Collaborator

@karimra karimra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@karimra karimra merged commit 9274fea into openconfig:main Sep 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants