-
Notifications
You must be signed in to change notification settings - Fork 348
Fix duplicate metrics registration in mysql datastore #2554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix duplicate metrics registration in mysql datastore #2554
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2554 +/- ##
==========================================
- Coverage 77.77% 77.77% -0.00%
==========================================
Files 440 440
Lines 53689 53690 +1
==========================================
- Hits 41751 41750 -1
- Misses 9344 9346 +2
Partials 2594 2594 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fdc53e5 to
7a35b83
Compare
When using a replica with the mysql datastore, we register the same metrics again and again. This commit ignores AlreadyRegisteredError when registering our custom metrics and adds a `db_name` label similar to the postgres instrumentation. Additionally, it updates the tests for multi instance creation in a way that we don't create 2 connections with the same index. Otherwise we would get another registration error when registering the sql collector `sqlstats`. fixes: authzed#2518 Signed-off-by: leonnicolas <[email protected]> Override the default Prometheus registry in tests again Some tests were failing when previous test cases registered their metrics with the default Prometheus registry. Signed-off-by: leonnicolas <[email protected]>
In order to increase the coverage of the patch, I added the following tests: - connection metrics can't be registered - duplicate db names are used to create the datastore Signed-off-by: leonnicolas <[email protected]>
7a35b83 to
8b2afbf
Compare
|
I hope I could increase the patch coverage with my last changes and fix the commit message format |
When using a replica with the mysql datastore, we register the
same metrics again and again.
This commit ignores AlreadyRegisteredError when registering our
custom metrics and adds a
db_namelabel similar to the postgresinstrumentation.
Additionally, it updates the tests for multi instance creation in a way that we
don't create 2 connections with the same index. Otherwise we would
get another registration error when registering the sql collector
sqlstats.fixes: #2518
Signed-off-by: leonnicolas [email protected]