-
Notifications
You must be signed in to change notification settings - Fork 888
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
no pool.name
in mysql (javascript)
#2958
Comments
Ideally the The |
@mateuszrzeszutek sound like a good idea. I'll implement this. thanks. |
@mateuszrzeszutek on another thinking, the 'config' contains all the details to connect to the db - including the password. Any idea what to do with this? |
How about only using selected fields to construct the name? E.g. host, port, database, user (an allowlist would probably be much safer than a list of exclusions) |
@mateuszrzeszutek I think it's a good idea. But if I'm not mistaken, the |
Yeah, that'd make the most sense. Alternatively (not sure if this is possible), you could inject instrumentation after the URL is parsed into a config object. |
I think we can close the issue.
@mateuszrzeszutek agree? |
Sounds good to me 👍 |
What are you trying to achieve?
I wanted to implement this metric https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/database-metrics.md#connection-pools and add the attribute
pool.name
for MySQL DB in javascript.What did you expect to see?
I expected that the MySQL library will have a field that identifies the pool. something like a name/id that distinguishes it from other pools.
Since there is no such field I wonder what should I do - should I create such an identifier myself? It will cause a weird situation where the user sees an attribute like
pool.name=4
that he didn't declare by himself...the code of the pool in Mysql is here: https://github.com/mysqljs/mysql/blob/master/index.js#L22
You can see the it is possible to give a
ConnectionConfig
when creating the pool, but I can’t find any ‘ID’ or 'name' field in this object: https://github.com/mysqljs/mysql/blob/dc9c152a87ec51a1f647447268917243d2eab1fd/lib/ConnectionConfig.js#L12The text was updated successfully, but these errors were encountered: