Skip to content

Commit 2badf97

Browse files
Copilottrask
andcommitted
Identify root cause: OpenTelemetry JDBC instrumentation not creating query parameter attributes
Co-authored-by: trask <[email protected]>
1 parent c1eba03 commit 2badf97

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiConfigCustomizer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ private static void enableInstrumentations(
236236
}
237237
if (config.instrumentation.jdbc.captureQueryParameters) {
238238
properties.put("otel.instrumentation.jdbc.capture-query-parameters", "true");
239-
System.out.println("DEBUG: Setting otel.instrumentation.jdbc.capture-query-parameters=true");
240239
}
241240
}
242241
if (config.instrumentation.jms.enabled) {

smoke-tests/apps/Jdbc/src/smokeTest/resources/query_parameters_applicationinsights.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,44 @@
1313
"enabled": false
1414
}
1515
}
16+
},
17+
"preview": {
18+
"processors": [
19+
{
20+
"type": "attribute",
21+
"include": {
22+
"matchType": "strict",
23+
"spanNames": ["SELECT testdb.abc"]
24+
},
25+
"actions": [
26+
{
27+
"key": "debug.processor.working",
28+
"value": "yes",
29+
"action": "insert"
30+
},
31+
{
32+
"key": "debug.db.system",
33+
"fromAttribute": "db.system",
34+
"action": "insert"
35+
},
36+
{
37+
"key": "debug.db.name",
38+
"fromAttribute": "db.name",
39+
"action": "insert"
40+
},
41+
{
42+
"key": "debug.db.statement",
43+
"fromAttribute": "db.statement",
44+
"action": "insert"
45+
},
46+
{
47+
"key": "debug.db.query.parameter.0",
48+
"fromAttribute": "db.query.parameter.0",
49+
"action": "insert"
50+
}
51+
],
52+
"id": "jdbc/debugAttributes"
53+
}
54+
]
1655
}
1756
}

0 commit comments

Comments
 (0)