Class MicrometerObservabilitySettings.Builder
java.lang.Object
com.mongodb.observability.micrometer.MicrometerObservabilitySettings.Builder
- Enclosing class:
- MicrometerObservabilitySettings
A builder for
MicrometerObservabilitySettings-
Method Summary
Modifier and TypeMethodDescriptionapplySettings(MicrometerObservabilitySettings settings) Applies the MicrometerObservabilitySettings to the builderbuild()enableCommandPayloadTracing(boolean enableCommandPayload) Sets the observation registry to use for creating tracing Spans for operations, commands and transactions.maxQueryTextLength(int maxQueryTextLength) Sets the maximum length of command payloads captured in tracing spans.observationConvention(io.micrometer.observation.ObservationConvention<MongodbObservationContext> observationConvention) Sets a customObservationConventionto control the tag names and values produced by MongoDB observations.observationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Sets the observation registry to use for creating tracing Spans for operations, commands and transactions.
-
Method Details
-
applySettings
public MicrometerObservabilitySettings.Builder applySettings(MicrometerObservabilitySettings settings) Applies the MicrometerObservabilitySettings to the builderNote: Overwrites all existing settings
- Parameters:
settings- the MicrometerObservabilitySettings- Returns:
- this
-
observationRegistry
public MicrometerObservabilitySettings.Builder observationRegistry(@Nullable io.micrometer.observation.ObservationRegistry observationRegistry) Sets the observation registry to use for creating tracing Spans for operations, commands and transactions.- Parameters:
observationRegistry- the observation registry- Returns:
- this
- Since:
- 5.7
-
enableCommandPayloadTracing
public MicrometerObservabilitySettings.Builder enableCommandPayloadTracing(boolean enableCommandPayload) Sets the observation registry to use for creating tracing Spans for operations, commands and transactions.- Parameters:
enableCommandPayload- whether command payloads should be captured in tracing spans. This may have performance implications so should be used with care.- Returns:
- this
- Since:
- 5.7
-
maxQueryTextLength
Sets the maximum length of command payloads captured in tracing spans. If not set, the entire command payload is captured.- Parameters:
maxQueryTextLength- the maximum length of command payloads captured in tracing spans.- Returns:
- this
- Since:
- 5.7
-
observationConvention
public MicrometerObservabilitySettings.Builder observationConvention(@Nullable io.micrometer.observation.ObservationConvention<MongodbObservationContext> observationConvention) Sets a customObservationConventionto control the tag names and values produced by MongoDB observations. If not set, the driver usesDefaultMongodbObservationConvention.- Parameters:
observationConvention- the custom convention, or null to use the default- Returns:
- this
- Since:
- 5.7
-
build
- Returns:
- the configured settings
-