Skip to content

Conversation

@adleong
Copy link
Member

@adleong adleong commented Aug 29, 2025

There are a number of places in the destination controller where prometheus metrics are constructed using the .With function to supply label names. The .With function panics if it encounters an invalid label name.

To avoid potential panics, we replace all uses of .With with the safer .GetMetricWith which instead returns an error if it is provided an invalid label name. We then handle these errors appropriately instead of panicking.

@adleong adleong requested a review from a team as a code owner August 29, 2025 21:41
@adleong adleong marked this pull request as draft August 29, 2025 23:08
@adleong adleong marked this pull request as ready for review September 2, 2025 15:57
@adleong adleong requested a review from alpeb September 2, 2025 16:30
Signed-off-by: Alex Leong <[email protected]>
@adleong adleong changed the title Replace With with GetMetricWith fix(destination): Replace With with GetMetricWith Sep 10, 2025
@adleong adleong merged commit 8410d1c into main Sep 10, 2025
67 of 69 checks passed
@adleong adleong deleted the alex/with-panic branch September 10, 2025 21:24
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.

3 participants