Interface DbClientAttributesGetter<REQUEST,RESPONSE>
- All Superinterfaces:
io.opentelemetry.instrumentation.api.semconv.network.NetworkAttributesGetter<REQUEST,,RESPONSE> io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter<REQUEST>
- All Known Subinterfaces:
SqlClientAttributesGetter<REQUEST,RESPONSE>
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the DbClientAttributesExtractor to obtain the
various 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 StringgetConnectionString(REQUEST request) Deprecated.There is no replacement at this time.default StringgetDbCollectionName(REQUEST request) default StringDeprecated.UsegetDbNamespace(Object)instead.getDbNamespace(REQUEST request) default StringgetDbOperation(REQUEST request) Deprecated.UsegetDbOperationName(Object)instead.default LonggetDbOperationBatchSize(REQUEST request) getDbOperationName(REQUEST request) getDbQueryParameters(REQUEST request) default StringgetDbQuerySummary(REQUEST request) getDbQueryText(REQUEST request) default StringgetDbSystem(REQUEST request) Deprecated.UsegetDbSystemName(REQUEST)instead.getDbSystemName(REQUEST request) default StringgetErrorType(REQUEST request, RESPONSE response, Throwable error) Returns a description of a class of error the operation ended with.default StringDeprecated.There is no replacement at this time.Methods 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
-
getDbQueryText
-
getDbQuerySummary
-
getDbOperationName
-
getDbOperation
Deprecated.UsegetDbOperationName(Object)instead.Returns the old db.operation value. This is only used for old semantic conventions. -
getDbSystemName
-
getDbSystem
Deprecated.UsegetDbSystemName(REQUEST)instead.Returns the old semconvdb.systemvalue. Defaults togetDbSystemName(REQUEST)for instrumentations where the old and new values are the same.Implementors whose old
db.systemvalue differs from the newdb.system.namevalue must override this method; otherwise old-semconv spans will silently emit the new value fordb.system. -
getDbNamespace
-
getDbCollectionName
-
getDbName
Deprecated.UsegetDbNamespace(Object)instead.Returns the old db.name value. This is only used for old semantic conventions. -
getUser
Deprecated.There is no replacement at this time.Returns the database user name. This is only used for old semantic conventions. -
getConnectionString
Deprecated.There is no replacement at this time.Returns the database connection string. This is only used for old semantic conventions. -
getDbOperationBatchSize
-
getDbQueryParameters
-
getErrorType
@Nullable default String getErrorType(REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error) Returns a description of a class of error the operation ended with.If this method returns
null, the exception class name (if any) will be used as error type.The cardinality of the error type should be low. The instrumentations implementing this method are recommended to document the custom values they support.
-