Skip to content

Commit

Permalink
Capture the auto-injection related settings in JFR recording
Browse files Browse the repository at this point in the history
  • Loading branch information
jbachorik committed Jul 12, 2024
1 parent 63f16d7 commit ce74934
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@ public void publish() {
datadogProfiler.recordSetting(JFR_IMPLEMENTATION_KEY, "ddprof");
datadogProfiler.recordSetting(STACK_DEPTH_KEY, String.valueOf(stackDepth));
datadogProfiler.recordSetting(SELINUX_STATUS_KEY, seLinuxStatus);
if (serviceInstrumentationType != null) {
datadogProfiler.recordSetting(SERVICE_INSTRUMENTATION_TYPE, serviceInstrumentationType);
}
if (serviceInjection != null) {
datadogProfiler.recordSetting(SERVICE_INJECTION, serviceInjection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public void publish() {
if (ddprofUnavailableReason != null) {
new ProfilerSettingEvent(DDPROF_UNAVAILABLE_REASON_KEY, ddprofUnavailableReason).commit();
}
if (serviceInstrumentationType != null) {
new ProfilerSettingEvent(SERVICE_INSTRUMENTATION_TYPE, serviceInstrumentationType).commit();
}
if (serviceInjection != null) {
new ProfilerSettingEvent(SERVICE_INJECTION, serviceInjection).commit();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public abstract class ProfilerSettingsSupport {
protected static final String NATIVE_STACKS_KEY = "Native Stacks";
protected static final String STACK_DEPTH_KEY = "Stack Depth";
protected static final String SELINUX_STATUS_KEY = "SELinux Status";
protected static final String SERVICE_INSTRUMENTATION_TYPE = "Service Instrumentation Type";
protected static final String SERVICE_INJECTION = "Service Injection";

protected static final String DDPROF_UNAVAILABLE_REASON_KEY = "DDProf Unavailable Reason";

Expand All @@ -50,6 +52,8 @@ public abstract class ProfilerSettingsSupport {
protected final String perfEventsParanoid;
protected final boolean hasNativeStacks;
protected final String seLinuxStatus;
protected final String serviceInstrumentationType;
protected final String serviceInjection;

protected final String ddprofUnavailableReason;

Expand Down Expand Up @@ -122,6 +126,13 @@ protected ProfilerSettingsSupport(
seLinuxStatus = getSELinuxStatus();
this.ddprofUnavailableReason = ddprofUnavailableReason;
this.hasJfrStackDepthApplied = hasJfrStackDepthApplied;

serviceInjection =
configProvider.getString(
"injection.enabled"); // usually set via DD_INJECTION_ENABLED env var
serviceInstrumentationType =
// usually set via DD_INSTRUMENTATION_INSTALL_TYPE env var
configProvider.getString("instrumentation.install.type");
}

private String getSELinuxStatus() {
Expand Down

0 comments on commit ce74934

Please sign in to comment.