Skip to content

Commit 29f4184

Browse files
committed
Unhook DbClientAttributesGetter from DbClientCommonAttributesGetter
- Removed extends DbClientCommonAttributesGetter from DbClientAttributesGetter - Copied non-deprecated methods (getDbSystemName, getDbNamespace, getResponseStatusCode) directly into DbClientAttributesGetter - This makes DbClientCommonAttributesGetter fully deprecated and independent - Maintains backward compatibility while moving towards removal of the deprecated interface
1 parent 7efa297 commit 29f4184

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesGetter.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@
2020
* from the attribute methods, but implement as many as possible for best compliance with the
2121
* OpenTelemetry specification.
2222
*/
23-
@SuppressWarnings("deprecation") // until DbClientCommonAttributesGetter is removed
2423
public interface DbClientAttributesGetter<REQUEST, RESPONSE>
25-
extends DbClientCommonAttributesGetter<REQUEST, RESPONSE>,
26-
NetworkAttributesGetter<REQUEST, RESPONSE>,
27-
ServerAttributesGetter<REQUEST> {
24+
extends NetworkAttributesGetter<REQUEST, RESPONSE>, ServerAttributesGetter<REQUEST> {
25+
26+
String getDbSystemName(REQUEST request);
27+
28+
@Nullable
29+
String getDbNamespace(REQUEST request);
30+
31+
@Nullable
32+
default String getResponseStatusCode(@Nullable RESPONSE response, @Nullable Throwable error) {
33+
return null;
34+
}
2835

2936
/**
3037
* @deprecated Use {@link #getDbQueryText(REQUEST)} instead.

0 commit comments

Comments
 (0)