fix(instrumentation-mysql, instrumentation-mongodb)!: replace deprecated db.client.connections.usage with db.client.connection.count in mongodb and mysql - #3608
Conversation
maryliag
left a comment
There was a problem hiding this comment.
Added a few comments, mostly because you update the metric name, but not the attributes
Pull request dashboard statusStatus last refreshed: 2026-07-22 20:10:32 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
|
This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature. |
|
Hey @maryliag , pushed a fix for all the comments: both packages now import and use db.client.connection.pool.name and db.client.connection.state from semconv instead of raw strings, and renamed poolNameOld to poolName in mysql. Let me know if I missed anything! |
|
Hi @maryliag ! Just a friendly follow-up on this PR 😊 |
maryliag
left a comment
There was a problem hiding this comment.
just a few nits (make sure you import the constant accordingly)
|
Looks like we need to merge this before releasing the semconv updates (ref #3596). |
…-orders); no functional change
|
Thank you for your contribution @Luffy-nani! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Which problem is this PR solving?
-
db.client.connections.usageis deprecated in favor ofdb.client.connection.count. The MongoDB and MySQL instrumentations still emit only the deprecated metric, with no path to the replacement.Fixes #3590
Short description of the changes
db.client.connections.usagewithdb.client.connection.countin bothinstrumentation-mongodbandinstrumentation-mysql, emitted unconditionally — matching the pattern already used byinstrumentation-pg(as confirmed in the discussion on feat!: only emit stable http, network and database attributes #3585).Related: #3585 (dependency, now merged)