Class MongoTelemetryBuilder

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

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

    • setStatementSanitizationEnabled

      @CanIgnoreReturnValue public MongoTelemetryBuilder setStatementSanitizationEnabled(boolean statementSanitizationEnabled)
      Sets whether the db.statement 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.