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

Capture the auto-injection related settings in JFR recording #7317

Merged
merged 1 commit into from
Jul 12, 2024
Merged
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
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
Loading