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

Add extra connection params as tags for JDBC statements #7055

Merged
merged 8 commits into from
May 23, 2024

Conversation

kr-igor
Copy link
Contributor

@kr-igor kr-igor commented May 21, 2024

Connection string for Snowflake contains additional attributes we want to add to spans as tags:

  • Schema
  • Warehouse
  • DB (instead of DatabaseName)

@kr-igor kr-igor marked this pull request as ready for review May 22, 2024 20:06
@kr-igor kr-igor requested review from a team as code owners May 22, 2024 20:06
@@ -122,6 +124,8 @@ protected String dbHostname(final DBInfo info) {
public AgentSpan onConnection(final AgentSpan span, DBInfo dbInfo) {
if (dbInfo != null) {
processDatabaseType(span, dbInfo.getType());
span.setTag(DB_WAREHOUSE, dbInfo.getWarehouse());
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: a null check on the value can be done before setting the tag (same for the schema) to avoid synchronizing the map of tags at span level for nothing.

Copy link
Collaborator

@amarziali amarziali left a comment

Choose a reason for hiding this comment

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

lgtm

@kr-igor kr-igor merged commit 58edd35 into master May 23, 2024
73 of 79 checks passed
@kr-igor kr-igor deleted the kr-igor/snowflake-connection-params branch May 23, 2024 17:05
@github-actions github-actions bot added this to the 1.35.0 milestone May 23, 2024
@amarziali amarziali added the inst: jdbc JDBC instrumentation label Jun 5, 2024
@PerfectSlayer PerfectSlayer changed the title [DO] - Extra connection params as tags for JDBC statements Add extra connection params as tags for JDBC statements Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: jdbc JDBC instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants