Interface SqlClientAttributesGetter<REQUEST,RESPONSE>
- All Superinterfaces:
DbClientAttributesGetter<REQUEST,,RESPONSE> io.opentelemetry.instrumentation.api.semconv.network.NetworkAttributesGetter<REQUEST,,RESPONSE> io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter<REQUEST>
public interface SqlClientAttributesGetter<REQUEST,RESPONSE>
extends DbClientAttributesGetter<REQUEST,RESPONSE>
An interface for getting SQL database client attributes.
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the SqlClientAttributesExtractor to obtain the
various SQL database client attributes in a type-generic way.
If an attribute is not available in this library, it is appropriate to return null
from the attribute methods, but implement as many as possible for best compliance with the
OpenTelemetry specification.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetDbOperationName(REQUEST request) SqlClientAttributesExtractor will try to populate db.operation.name based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the operation name.default StringgetDbQuerySummary(REQUEST request) SqlClientAttributesExtractor will try to populate db.query.summary based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the query summary.default StringgetDbQueryText(REQUEST request) SqlClientAttributesExtractor will try to populate db.query.text based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the query text.getRawQueryTexts(REQUEST request) Get the raw SQL query texts.getSqlDialect(REQUEST request) Returns the SQL dialect used by the database.default booleanisParameterizedQuery(REQUEST request) Returns whether the query is parameterized.Methods inherited from interface io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesGetter
getConnectionString, getDbName, getDbNamespace, getDbOperationBatchSize, getDbQueryParameters, getDbSystem, getDbSystemName, getErrorType, getUserMethods inherited from interface io.opentelemetry.instrumentation.api.semconv.network.NetworkAttributesGetter
getNetworkLocalAddress, getNetworkLocalInetSocketAddress, getNetworkLocalPort, getNetworkPeerAddress, getNetworkPeerInetSocketAddress, getNetworkPeerPort, getNetworkProtocolName, getNetworkProtocolVersion, getNetworkTransport, getNetworkTypeMethods inherited from interface io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter
getServerAddress, getServerPort
-
Method Details
-
getDbOperationName
SqlClientAttributesExtractor will try to populate db.operation.name based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the operation name.- Specified by:
getDbOperationNamein interfaceDbClientAttributesGetter<REQUEST,RESPONSE>
-
getDbQueryText
SqlClientAttributesExtractor will try to populate db.query.text based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the query text.- Specified by:
getDbQueryTextin interfaceDbClientAttributesGetter<REQUEST,RESPONSE>
-
getDbQuerySummary
SqlClientAttributesExtractor will try to populate db.query.summary based ongetRawQueryTexts(REQUEST), but this can be used to explicitly provide the query summary.- Specified by:
getDbQuerySummaryin interfaceDbClientAttributesGetter<REQUEST,RESPONSE>
-
getSqlDialect
Returns the SQL dialect used by the database. -
getRawQueryTexts
Get the raw SQL query texts. The values returned by this method are later sanitized by theSqlClientAttributesExtractorbefore being set as span attribute.If
requestis not a batch query, then this method should return a collection with a single element. -
isParameterizedQuery
Returns whether the query is parameterized. Prepared statements are always considered parameterized even if no parameters are bound. By using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and so the query does not need to be sanitized. See sanitization of db.query.text.
-