Class MicrometerObservabilitySettings
java.lang.Object
com.mongodb.observability.ObservabilitySettings
com.mongodb.observability.micrometer.MicrometerObservabilitySettings
The Micrometer Observation settings for tracing operations, commands and transactions.
If tracing is configured by supplying an observationRegistry then setting the environment variable
"OBSERVABILITY_MONGODB_ENABLED" is used to enable or disable the
creation of tracing spans.
If set the environment variable
"OBSERVABILITY_MONGODB_QUERY_TEXT_MAX_LENGTH"
will be used to determine the maximum length of command payloads captured in tracing spans.
If the environment variable is not set, the entire command payloads are captured (unless a maxQueryTextLength is specified via
the Builder).
- Since:
- 5.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forMicrometerObservabilitySettings -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Convenience method to create a Builder.builder(MicrometerObservabilitySettings settings) Convenience method to create a builder from an existingMicrometerObservabilitySettings.booleanintio.micrometer.observation.ObservationConvention<MongodbObservationContext>io.micrometer.observation.ObservationRegistryinthashCode()booleanMethods inherited from class com.mongodb.observability.ObservabilitySettings
micrometerBuilder
-
Method Details
-
builder
Convenience method to create a Builder.- Returns:
- a builder
-
builder
public static MicrometerObservabilitySettings.Builder builder(MicrometerObservabilitySettings settings) Convenience method to create a builder from an existingMicrometerObservabilitySettings.- Parameters:
settings- create a builder from existing settings- Returns:
- a builder
-
getObservationRegistry
- Returns:
- the observation registry or null
-
isEnableCommandPayloadTracing
public boolean isEnableCommandPayloadTracing()- Returns:
- true if command payload tracing is enabled
-
getObservationConvention
@Nullable public io.micrometer.observation.ObservationConvention<MongodbObservationContext> getObservationConvention()- Returns:
- the observation convention, or null to use the default
-
getMaxQueryTextLength
public int getMaxQueryTextLength()- Returns:
- the maximum length of command payloads captured in tracing spans.
-
equals
-
hashCode
public int hashCode()
-