Class MongoTelemetryBuilder

java.lang.Object
io.opentelemetry.instrumentation.mongo.v3_1.MongoTelemetryBuilder

public final class MongoTelemetryBuilder extends Object
A builder of MongoTelemetry.
  • Method Details

    • setQuerySanitizationEnabled

      @CanIgnoreReturnValue public MongoTelemetryBuilder setQuerySanitizationEnabled(boolean querySanitizationEnabled)
      Sets whether the db.statement/db.query.text attribute on the spans emitted by the constructed MongoTelemetry should be sanitized. If set to true, all parameters that can potentially contain sensitive information will be masked. Enabled by default.
    • setMaxNormalizedQueryLength

      @CanIgnoreReturnValue public MongoTelemetryBuilder setMaxNormalizedQueryLength(int maxNormalizedQueryLength)
      Sets the max length of recorded queries after normalization. Defaults to 32768.
    • build

      public MongoTelemetry build()
      Returns a new MongoTelemetry with the settings of this MongoTelemetryBuilder.