chore(prometheus): improve logging when having the inconsistent labels count
Summary
Currently, the Prometheus plugin will log the following error if we have encountered an inconsistent label count while debugging:
[error]... inconsistent labels count, expected 6, got 5
It's hard to identify which metric is going wrong, and it will be helpful if we can bring the metric name as well:
[error]... metric 'bandwidth_bytes' has the inconsistent labels count, expected 6, got 5
Checklist
- [ ] The Pull Request has tests
- [ ] A changelog file has been created under
changelog/unreleased/kongorskip-changeloglabel added on PR if changelog is unnecessary. README.md - [ ] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE
@oowl Would you mind taking a look at this PR?
https://github.com/Kong/kong/actions/runs/9072858739/job/24943120249?pr=13020#step:20:2126 The CI failure is not related to this PR.
@chronolaw @StarlightIbuki could you help to take a look at this PR?
@chronolaw @oowl @StarlightIbuki, is this PR good to merge?
@ADD-SP Would you mind having a look at this PR?
@git-hulk Thanks for your contribution!
Successfully created cherry-pick PR for master:
- https://github.com/kong/kong-ee/pull/9361
@ADD-SP Thank you!