-
public class ElasticApmConfiguration.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private HttpTraceConfigurationhttpTraceConfigurationprivate InstrumentationConfigurationinstrumentationConfigurationprivate PersistenceConfigurationpersistenceConfigurationprivate StringserviceNameprivate StringserviceVersionprivate StringdeploymentEnvironmentprivate SessionIdGeneratorsessionIdGeneratorprivate SignalConfigurationsignalConfigurationprivate doublesampleRateprivate ExportProtocolexportProtocolprivate LoggingPolicylibraryLoggingPolicyprivate Resourceresource
-
Method Summary
Modifier and Type Method Description ElasticApmConfiguration.BuildersetHttpTraceConfiguration(HttpTraceConfiguration httpTraceConfiguration)Allows for configuring HTTP-related spans, such as, adding extra attributes and/or ignoringsome HTTP requests based on their structure. ElasticApmConfiguration.BuildersetInstrumentationConfiguration(InstrumentationConfiguration instrumentationConfiguration)Used to enable/disable automatic instrumentations. ElasticApmConfiguration.BuildersetPersistenceConfiguration(PersistenceConfiguration persistenceConfiguration)Sets the parameters for caching signals in disk in order to export them later. ElasticApmConfiguration.BuildersetServiceName(String serviceName)This method sets up OpenTelemetry's `service.name` resource attribute for every signal. ElasticApmConfiguration.BuildersetServiceVersion(String serviceVersion)This method sets up OpenTelemetry's `service.version` resource attribute for every signal. ElasticApmConfiguration.BuildersetDeploymentEnvironment(String deploymentEnvironment)This method sets up OpenTelemetry's `deployment.environment` resource attribute for every signal. ElasticApmConfiguration.BuildersetSessionIdGenerator(SessionIdGenerator sessionIdGenerator)The session ID generator will be used when a new session is created, the id provided by this generator will be the session ID.By default, a UUID is generated. ElasticApmConfiguration.BuildersetSignalConfiguration(SignalConfiguration signalConfiguration)This can be used to override OpenTelemetry's processors and exporters for all signals. ElasticApmConfiguration.BuildersetSampleRate(double sampleRate)Allows values from 0 to 1 where 1 means that all signals from a session are exported, and 0 means nosignals are exported. ElasticApmConfiguration.BuildersetExportProtocol(ExportProtocol exportProtocol)Sets the protocol that will be used to export OpenTelemetry signals. ElasticApmConfiguration.BuildersetLibraryLoggingPolicy(LoggingPolicy libraryLoggingPolicy)Sets the logging policy for this library's internal logs. ElasticApmConfiguration.BuildersetResource(Resource resource)Sets the base OpenTelemetry resource for all signals. ElasticApmConfiguration.BuilderaddSpanFilter(SpanFilter spanFilter)The span filter can be used to control which spans are exported and which shouldn'tleave the device. ElasticApmConfiguration.BuilderaddLogFilter(LogFilter logFilter)The log filter can be used to control which log records are exported and which shouldn'tleave the device. ElasticApmConfiguration.BuilderaddMetricFilter(MetricFilter metricFilter)The metric filter can be used to control which metrics are exported and which shouldn'tleave the device. ElasticApmConfigurationbuild()-
-
Method Detail
-
setHttpTraceConfiguration
ElasticApmConfiguration.Builder setHttpTraceConfiguration(HttpTraceConfiguration httpTraceConfiguration)
Allows for configuring HTTP-related spans, such as, adding extra attributes and/or ignoringsome HTTP requests based on their structure.
-
setInstrumentationConfiguration
ElasticApmConfiguration.Builder setInstrumentationConfiguration(InstrumentationConfiguration instrumentationConfiguration)
Used to enable/disable automatic instrumentations.
-
setPersistenceConfiguration
ElasticApmConfiguration.Builder setPersistenceConfiguration(PersistenceConfiguration persistenceConfiguration)
Sets the parameters for caching signals in disk in order to export them later.
-
setServiceName
ElasticApmConfiguration.Builder setServiceName(String serviceName)
This method sets up OpenTelemetry's `service.name` resource attribute for every signal.
Despite its name, in this context it should refer to the application name.
- Parameters:
serviceName- - The application name
-
setServiceVersion
ElasticApmConfiguration.Builder setServiceVersion(String serviceVersion)
This method sets up OpenTelemetry's `service.version` resource attribute for every signal.
Despite its name, in this context it should refer to the application version name.
- Parameters:
serviceVersion- - The application version name
-
setDeploymentEnvironment
ElasticApmConfiguration.Builder setDeploymentEnvironment(String deploymentEnvironment)
This method sets up OpenTelemetry's `deployment.environment` resource attribute for every signal.
- Parameters:
deploymentEnvironment- - The application environment
-
setSessionIdGenerator
ElasticApmConfiguration.Builder setSessionIdGenerator(SessionIdGenerator sessionIdGenerator)
The session ID generator will be used when a new session is created, the id provided by this generator will be the session ID.By default, a UUID is generated.
-
setSignalConfiguration
ElasticApmConfiguration.Builder setSignalConfiguration(SignalConfiguration signalConfiguration)
This can be used to override OpenTelemetry's processors and exporters for all signals.
-
setSampleRate
ElasticApmConfiguration.Builder setSampleRate(double sampleRate)
Allows values from 0 to 1 where 1 means that all signals from a session are exported, and 0 means nosignals are exported. The value set in here is applied per session, at the time a new sessionis created, this value will define whether the whole session's signals get exported or not.
-
setExportProtocol
ElasticApmConfiguration.Builder setExportProtocol(ExportProtocol exportProtocol)
Sets the protocol that will be used to export OpenTelemetry signals. This is meant to workwith the default SignalConfiguration, so if a custom SignalConfiguration is set, thenthe export protocol used in there might not be determined by this configuration param.
-
setLibraryLoggingPolicy
ElasticApmConfiguration.Builder setLibraryLoggingPolicy(LoggingPolicy libraryLoggingPolicy)
Sets the logging policy for this library's internal logs. By default, it will log all the LogLevels on debuggable applicationsand only logs from level INFO and above for non-debuggable applications.
-
setResource
ElasticApmConfiguration.Builder setResource(Resource resource)
Sets the base OpenTelemetry resource for all signals.
-
addSpanFilter
ElasticApmConfiguration.Builder addSpanFilter(SpanFilter spanFilter)
The span filter can be used to control which spans are exported and which shouldn'tleave the device. An implementation that always excludes all spans is essentially a wayto turn all spans off.
-
addLogFilter
ElasticApmConfiguration.Builder addLogFilter(LogFilter logFilter)
The log filter can be used to control which log records are exported and which shouldn'tleave the device. An implementation that always excludes all logs is essentially a wayto turn all log records off.
-
addMetricFilter
ElasticApmConfiguration.Builder addMetricFilter(MetricFilter metricFilter)
The metric filter can be used to control which metrics are exported and which shouldn'tleave the device. An implementation that always excludes all metrics is essentially a wayto turn all metrics off.
-
build
ElasticApmConfiguration build()
-
-
-
-