Class SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE>
A builder of
SqlClientAttributesExtractor.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newSqlClientAttributesExtractorwith the settings of thisSqlClientAttributesExtractorBuilder.setCaptureQueryParameters(boolean captureQueryParameters) Sets whether the query parameters should be captured as span attributes nameddb.query.parameter.<key>.setQuerySanitizationEnabled(boolean querySanitizationEnabled) Sets whether thedb.query.textattribute extracted by the constructedSqlClientAttributesExtractorshould be sanitized.setSingleOperationAndCollection(boolean singleOperationAndCollection) Sets whetherdb.operation.nameanddb.collection.namecan be derived fromdb.query.text.setTableAttribute(io.opentelemetry.api.common.AttributeKey<String> oldSemconvTableAttribute) Deprecated.new semantic conventions always use db.collection.name
-
Method Details
-
setTableAttribute
@CanIgnoreReturnValue @Deprecated public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setTableAttribute(@Nullable io.opentelemetry.api.common.AttributeKey<String> oldSemconvTableAttribute) Deprecated.new semantic conventions always use db.collection.nameSets the attribute key for the old semconv table attribute. Passnullto disable emitting any table attribute under old semconv. -
setQuerySanitizationEnabled
@CanIgnoreReturnValue public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setQuerySanitizationEnabled(boolean querySanitizationEnabled) Sets whether thedb.query.textattribute extracted by the constructedSqlClientAttributesExtractorshould be sanitized. If set totrue, 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 nameddb.query.parameter.<key>. Enabling this option disables the query sanitization. Disabled by default.WARNING: captured query parameters may contain sensitive information such as passwords, personally identifiable information or protected health info.
-
setSingleOperationAndCollection
@CanIgnoreReturnValue public SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> setSingleOperationAndCollection(boolean singleOperationAndCollection) Sets whetherdb.operation.nameanddb.collection.namecan be derived fromdb.query.text.Enable this only when the database system does not support query text with multiple operations or multiple collections in non-batch operations. For most instrumentations, enabling this will produce invalid semantic conventions.
-
build
public io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> build()Returns a newSqlClientAttributesExtractorwith the settings of thisSqlClientAttributesExtractorBuilder.
-