Skip to content

Container hash tags propagation #9282

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions dd-java-agent/instrumentation/jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ addTestSuiteExtendingForDir('latestDepJava11Test', 'latestDepTest', 'test')
dependencies {
compileOnly group: 'com.zaxxer', name: 'HikariCP', version: '2.4.0'
testImplementation(testFixtures(project(':dd-java-agent:agent-iast')))
implementation project(':utils:container-utils')

// jdbc unit testing
testImplementation group: 'com.h2database', name: 'h2', version: '[1.3.168,1.3.169]'// first jdk 1.6 compatible
Expand Down Expand Up @@ -85,8 +86,3 @@ tasks.named("latestDepJava11Test").configure {
tasks.withType(Test).configureEach {
usesService(testcontainersLimit)
}

jmh {
jmhVersion = libs.versions.jmh.get()
duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public static String onEnter(
if (callDepth > 0) {
return null;
}
final String inputSql = sql;
final DBInfo dbInfo =
JDBCDecorator.parseDBInfo(
connection, InstrumentationContext.get(Connection.class, DBInfo.class));
Expand All @@ -125,16 +124,9 @@ public static String onEnter(
dbService =
traceConfig(activeSpan()).getServiceMapping().getOrDefault(dbService, dbService);
}
if (dbInfo.getType().equals("sqlserver")) {
sql =
SQLCommenter.append(
sql, dbService, dbInfo.getType(), dbInfo.getHost(), dbInfo.getDb());
} else {
sql =
SQLCommenter.prepend(
sql, dbService, dbInfo.getType(), dbInfo.getHost(), dbInfo.getDb());
}
return inputSql;
boolean append = "sqlserver".equals(dbInfo.getType());
return SQLCommenter.inject(
sql, dbService, dbInfo.getType(), dbInfo.getHost(), dbInfo.getDb(), null, append);
}
return sql;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public class JDBCDecorator extends DatabaseClientDecorator<DBInfo> {

public static final String DD_INSTRUMENTATION_PREFIX = "_DD_";

public static final String DBM_PROPAGATION_MODE = Config.get().getDBMPropagationMode();
public static final String DBM_PROPAGATION_MODE = Config.get().getDbmPropagationMode();
public static final boolean INJECT_COMMENT =
DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_FULL)
|| DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_STATIC);
private static final boolean INJECT_TRACE_CONTEXT =
DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_FULL);
public static final boolean DBM_TRACE_PREPARED_STATEMENTS =
Config.get().isDBMTracePreparedStatements();
Config.get().isDbmTracePreparedStatements();

private volatile boolean warnedAboutDBMPropagationMode = false; // to log a warning only once

Expand Down Expand Up @@ -420,7 +420,7 @@ public boolean shouldInjectTraceContext(DBInfo dbInfo) {
}

public boolean shouldInjectSQLComment() {
return Config.get().getDBMPropagationMode().equals(DBM_PROPAGATION_MODE_FULL)
|| Config.get().getDBMPropagationMode().equals(DBM_PROPAGATION_MODE_STATIC);
return Config.get().getDbmPropagationMode().equals(DBM_PROPAGATION_MODE_FULL)
|| Config.get().getDbmPropagationMode().equals(DBM_PROPAGATION_MODE_STATIC);
}
}
Loading
Loading