Skip to content

Commit

Permalink
Enable the capture of OTel code attributes with a json property
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbisutti committed Sep 14, 2022
1 parent bad6faa commit d5ce9a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public static class JdbcMasking {

public static class LoggingInstrumentation {
public String level = "INFO";
public boolean captureCodeAttributes;

public Severity getSeverity() {
return getSeverity(level);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ private static void enableInstrumentations(Configuration config, Map<String, Str
if (config.instrumentation.springScheduling.enabled) {
properties.put("otel.instrumentation.spring-scheduling.enabled", "true");
}
if (config.instrumentation.logging.captureCodeAttributes) {
properties.put(
"otel.instrumentation.logback-appender.experimental.capture-code-attributes", "true");
}
if (config.preview.instrumentation.akka.enabled) {
properties.put("otel.instrumentation.akka-actor.enabled", "true");
properties.put("otel.instrumentation.akka-http.enabled", "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"instrumentation": {
"logging": {
"level": "warn"
"level": "warn",
"captureCodeAttributes": true
}
}
}

0 comments on commit d5ce9a5

Please sign in to comment.