Interface SqlClientAttributesGetter<REQUEST,RESPONSE>
- All Superinterfaces:
DbClientCommonAttributesGetter<REQUEST,RESPONSE>
public interface SqlClientAttributesGetter<REQUEST,RESPONSE>
extends DbClientCommonAttributesGetter<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 LonggetBatchSize(REQUEST request) default StringgetRawQueryText(REQUEST request) Deprecated.default Collection<String> getRawQueryTexts(REQUEST request) Get the raw SQL query texts.default StringgetRawStatement(REQUEST request) Deprecated.UsegetRawQueryText(Object)instead.Methods inherited from interface io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientCommonAttributesGetter
getConnectionString, getDbNamespace, getDbSystem, getName, getResponseStatus, getSystem, getUser
-
Method Details
-
getRawStatement
Deprecated.UsegetRawQueryText(Object)instead.Get the raw SQL statement. The value returned by this method is later sanitized by theSqlClientAttributesExtractorbefore being set as span attribute. -
getRawQueryText
Deprecated.UsegetRawQueryTexts(Object)instead.Get the raw SQL query text. The value returned by this method is later sanitized by theSqlClientAttributesExtractorbefore being set as span attribute. -
getRawQueryTexts
Get the raw SQL query texts. The values returned by this method is 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. -
getBatchSize
-
getRawQueryTexts(Object)instead.