diff --git a/apm-agent-core/src/main/java/co/elastic/apm/report/ApmServerReporter.java b/apm-agent-core/src/main/java/co/elastic/apm/report/ApmServerReporter.java index c0b9a4b9c0..8816923264 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/report/ApmServerReporter.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/report/ApmServerReporter.java @@ -105,6 +105,9 @@ public Thread newThread(Runnable r) { }, ProducerType.MULTI, PhasedBackoffWaitStrategy.withLock(1, 10, TimeUnit.MILLISECONDS)); this.coreConfiguration = coreConfiguration; reportingEventHandler = new ReportingEventHandler(service, process, system, payloadSender, reporterConfiguration, processorEventHandler); + if (!reporterConfiguration.isIncludeProcessArguments()) { + process.getArgv().clear(); + } disruptor.handleEventsWith(reportingEventHandler); disruptor.start(); if (reporterConfiguration.getFlushInterval() > 0) { diff --git a/apm-agent-core/src/main/java/co/elastic/apm/report/ReporterConfiguration.java b/apm-agent-core/src/main/java/co/elastic/apm/report/ReporterConfiguration.java index 7df310996d..dbbacb9272 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/report/ReporterConfiguration.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/report/ReporterConfiguration.java @@ -91,6 +91,13 @@ public class ReporterConfiguration extends ConfigurationOptionProvider { "Blocks the requests until the transaction has been reported to the APM server.") .buildWithDefault(false); + private final ConfigurationOption includeProcessArguments = ConfigurationOption.booleanOption() + .key("include_process_args") + .configurationCategory(REPORTER_CATEGORY) + .description("Whether each transaction should have the process arguments attached.\n" + + "Disabled by default to save disk space.") + .buildWithDefault(false); + @Nullable public String getSecretToken() { return secretToken.get(); @@ -119,4 +126,8 @@ public int getMaxQueueSize() { public boolean isReportSynchronously() { return reportSynchronously.get(); } + + public boolean isIncludeProcessArguments() { + return includeProcessArguments.get(); + } } diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index fe54ce0f9c..adcc66c5f3 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -517,6 +517,27 @@ This setting is useful to limit memory consumption if you experience a sudden sp | `elastic.apm.max_queue_size` | `ELASTIC_APM_MAX_QUEUE_SIZE` |============ +[float] +[[config-include-process-args]] +==== `include_process_args` + +Whether each transaction should have the process arguments attached. +Disabled by default to save disk space. + + +[options="header"] +|============ +| Default | Type | Dynamic +| `false` | Boolean | false +|============ + + +[options="header"] +|============ +| Java System Properties | Environment +| `elastic.apm.include_process_args` | `ELASTIC_APM_INCLUDE_PROCESS_ARGS` +|============ + [[config-stacktrace]] === Stacktrace configuration options [float]