-
Notifications
You must be signed in to change notification settings - Fork 277
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
Allow specifying a readable service name for databases when the JDBC url has IP Address #6514
Comments
Hi @sriraamas. I believe you should be able to achieve this by utilizing service mapping ( |
I assume you are recommending using service mapping to map
`mysql` to `user-writer-instance.db.com`
I have looked into this and it doesn't work for us in two situations:
1. One of our services connects to many database hosts and I would like
each database host to appear as a separate service in APM
2. We have each service using both reader hosts and writer hosts and I
would like each host to be a separate service in APM
|
Hi @sriraamas, could you try using
|
fwiw, I verified that this works. The workaround recommended works but it is a lot of additional work. |
It is also somewhat problematic because the ip to name mapping must be know at startup time. The reason we use ip addresses instead of a domain name is so that we can quickly detect if the DNS changed, and properly drain existing connections. But that means we don't necessarily know the mapping initially. (I work with sriraamas) |
@sriraamas @tmccombs another option to try which can vary based on your setup is to use the option This will change the service name being used to be the instance, which can vary based on the connection string you're using. You may be able to use that in conjunction with |
In our case, by default, db-instance is set to the database being used. so are you saying, if its user database in the user-db host, do service.mapping from user to user.db.com ? The downside there is, we have both reader and writer hosts being used on the same database instance. so, I can't know if its reader/writer. |
Thanks for sharing that Given the information you provided, it indicates that |
I am not certain how to set a tag for JDBC Auto instrumentation. I thought
that's not possible.
|
Hi @sriraamas thank you for your patience. I'm reaching out to confirm that, without custom instrumentation, you are correct In this case, we'll attach this issue to a feature request internally and consider it as part of our long-term roadmap. Please use the options specified above until then |
In our application, we use IP address in the JDBC url to connect to our database, like:
jdbc://10.4.2.1:3306/test_database
This means that the service name is 10.4.2.1 when I leverage trace.db.client.split-by-host configuration.
However, we would like to specify the service name for this database as a connection parameter to jdbc like:
jdbc://10.4.2.1:3306/test_database?serviceName=user-writer-instance.db.com
Currently, the serverName parameter is lost during runtime because its overridden by the actual host of the jdbc url, which is 10.4.2.1
The text was updated successfully, but these errors were encountered: