Skip to content

Conversation

LloydW93
Copy link
Contributor

I recently had a bug in a service using foundations where the buckets in my histogram were not in ascending order because of a typo. Instead of this being detected and handled in any way, I just had a broken metric.

This change adds compile time checks when using the metrics proc macro to, if the buckets are provided directly, check the ordering. It doesn't check if they're passed from a variable or function or any other method, and I think the only way to do that would be runtime validation - the binary would consistently fail to start immediately, but have kept this constrained to a compile-time check for now to get thoughts/feedback.

@fisherdarling fisherdarling force-pushed the histogram-bucket-validation branch from 99ad34d to 5187e99 Compare August 27, 2025 09:50
@fisherdarling
Copy link
Collaborator

rebased

@fisherdarling fisherdarling force-pushed the histogram-bucket-validation branch from 5187e99 to d672501 Compare August 27, 2025 09:54
@fisherdarling
Copy link
Collaborator

fixed some clippy issues

@fisherdarling fisherdarling merged commit 5f86979 into cloudflare:main Aug 27, 2025
18 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.

4 participants