Skip to content

Commit 4674407

Browse files
committed
Delete DbClientCommonAttributesGetter and consolidate into DbClientAttributesGetter
- Removed DbClientCommonAttributesGetter interface entirely - Added deprecated getDbSystem() and getResponseStatus() methods to DbClientAttributesGetter with default implementations that delegate to the new method names - This provides a one-release deprecation cycle since these methods weren't deprecated in the previous release - Also carried over deprecated getUser() and getConnectionString() methods - All functionality now consolidated in DbClientAttributesGetter
1 parent a9523a3 commit 4674407

File tree

2 files changed

+29
-39
lines changed

2 files changed

+29
-39
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public interface DbClientAttributesGetter<REQUEST, RESPONSE>
2525

2626
String getDbSystemName(REQUEST request);
2727

28+
/**
29+
* @deprecated Use {@link #getDbSystemName(REQUEST)} instead.
30+
*/
31+
@Deprecated
32+
default String getDbSystem(REQUEST request) {
33+
return getDbSystemName(request);
34+
}
35+
2836
@Nullable
2937
String getDbNamespace(REQUEST request);
3038

@@ -33,6 +41,27 @@ default String getResponseStatusCode(@Nullable RESPONSE response, @Nullable Thro
3341
return null;
3442
}
3543

44+
/**
45+
* @deprecated Use {@link #getResponseStatusCode(RESPONSE, Throwable)} instead.
46+
*/
47+
@Deprecated
48+
@Nullable
49+
default String getResponseStatus(@Nullable RESPONSE response, @Nullable Throwable error) {
50+
return getResponseStatusCode(response, error);
51+
}
52+
53+
@Deprecated
54+
@Nullable
55+
default String getUser(REQUEST request) {
56+
return null;
57+
}
58+
59+
@Deprecated
60+
@Nullable
61+
default String getConnectionString(REQUEST request) {
62+
return null;
63+
}
64+
3665
/**
3766
* @deprecated Use {@link #getDbQueryText(REQUEST)} instead.
3867
*/

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

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)