Skip to content
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

Fix derby directory connection string parser #12479

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

jaydeluca
Copy link
Member

Related to #12400

Updates the derby connection parser to use the value after the last / to account for directory structures when pulling the database name out of a connection string like: /usr/ibm/pep/was9/ibm/websphere/appserver/profiles/<REDACTED>/databases/ejbtimers/<HOST_REDACTED>/ejbtimerdb

Unrelated to this change, I also refactored the tests a bit to have separate test methods and argument classes for each database type because I found having all databases in the same test made it annoying when debugging. If we would prefer to keep it the way it was I can swap it back.

The issue also reported a problem with Oracle parsing, but when using the connection string provided in a test, things seem to work as expected.

@jaydeluca jaydeluca requested a review from a team as a code owner October 20, 2024 00:39
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Oct 20, 2024
Comment on lines +562 to +569
arg("jdbc:oracle:thin:@(description = (connect_timeout=90)(retry_count=20)(retry_delay=3) (transport_connect_timeout=3000) (address_list = (load_balance = on) (failover = on) (address = (protocol = tcp)(host = orcl.host1)(port = 1521)) (address = (protocol = tcp)(host = orcl.host2)(port = 1521)) (address = (protocol = tcp)(host = orcl.host3)(port = 1521)) (address = (protocol = tcp)(host = orcl.host4)(port = 1521)) ) (connect_data = (server = dedicated) (service_name = orclsn)))")
.setShortUrl("oracle:thin://orcl.host1:1521")
.setSystem("oracle")
.setSubtype("thin")
.setHost("orcl.host1")
.setPort(1521)
.setName("orclsn")
.build(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an attempt to reproduce the example provided in the issue, but as far as I can tell it seems to work as expected

Comment on lines +1116 to +1122
arg("jdbc:derby:directory:/usr/ibm/pep/was9/ibm/websphere/appserver/profiles/my_profile/databases/ejbtimers/myhostname/ejbtimerdb")
.setShortUrl("derby:directory:")
.setSystem("derby")
.setSubtype("directory")
.setUser("APP")
.setName("ejbtimerdb")
.build());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the new test case using the example from the issue

@trask trask merged commit a1c3728 into open-telemetry:main Oct 21, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants