-
Notifications
You must be signed in to change notification settings - Fork 325
Closed
Labels
Description
Is your feature request related to a problem?
This is a follow-up issue on #1800 (use either Connection#getCatalog or Connection#getSchema for db.instance field, which is covered by pr #1820 .
In some cases mentioned in #1800 (comment), we can't use getCatalog and proper JDBC URL parsing seems the right option to populate the db.instance field.
Describe the solution you'd like
- try to parse the
db.instancevalue from JDBC URL. - for Oracle, rely in the
SERVICE_NAMEattribute in JDBC URL if provided, with fallback toSIDorINSTANCE_NAME - when it can't be parsed, then we should fallback to using
Connection#getConnectionat the time when the connection is created.
While Connection#setCatalog (or Connection#setSchema) could be called at runtime to change the current catalog on the connection, this feature is assumed to be quite rarely used, and would further complicate things. Also, keeping a stable value over time that would be consistent with application configuration (here the JDBC URL) seems a reasonable option.
Additional context
- few other Oracle examples Add database/schema name to JDBC spans #1800 (comment)
- Oracle documentation https://docs.oracle.com/cd/E11882_01/network.112/e41945/concepts.htm#NETAG253
Reactions are currently unavailable