Class SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE>

java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE>

public final class SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> extends Object
  • Method Details

    • setTableAttribute

      @CanIgnoreReturnValue @Deprecated public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setTableAttribute(io.opentelemetry.api.common.AttributeKey<String> oldSemconvTableAttribute)
      Deprecated.
      not needed anymore since the new semantic conventions always use db.collection.name
    • setStatementSanitizationEnabled

      @CanIgnoreReturnValue public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setStatementSanitizationEnabled(boolean statementSanitizationEnabled)
      Sets whether the db.statement attribute extracted by the constructed SqlClientAttributesExtractor should be sanitized. If set to true, all parameters that can potentially contain sensitive information will be masked. Enabled by default.
    • setCaptureQueryParameters

      @CanIgnoreReturnValue public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setCaptureQueryParameters(boolean captureQueryParameters)
      Sets whether the query parameters should be captured as span attributes named db.query.parameter.<key>. Enabling this option disables the statement sanitization. Disabled by default.

      WARNING: captured query parameters may contain sensitive information such as passwords, personally identifiable information or protected health info.

    • build

      public io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> build()
      Returns a new SqlClientAttributesExtractor with the settings of this SqlClientAttributesExtractorBuilder.