Skip to content

Conversation

infureal
Copy link
Contributor

@infureal infureal commented Sep 19, 2025

Improve histogram buckets assertion error message for better debugging when error is occurred.

Old message

Expected a non-empty value. Got: array

New message

Buckets with values are empty for [sample_metrics] with key [sample_metrics|{"a":"b"}]

@zlodes zlodes requested review from Copilot and zlodes September 19, 2025 11:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the error message for histogram bucket assertions to provide better debugging context when empty buckets are encountered.

  • Enhanced the Assert::notEmpty() call to include a descriptive error message with metric name and key information
  • Replaced a generic assertion error with a specific message that identifies the problematic metric

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Owner

@zlodes zlodes left a comment

Choose a reason for hiding this comment

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

LGTM

@zlodes zlodes changed the title chore: Improve asserting error message feat: improve histogram buckets asserting error message Sep 19, 2025
@zlodes zlodes merged commit d8e8235 into zlodes:master Sep 19, 2025
19 checks passed
@infureal infureal deleted the error-message branch September 19, 2025 11:51
Copy link

🎉 This PR is included in version 2.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants