Skip to content

Commit cfa0383

Browse files
authored
More database terminology alignment (#16147)
1 parent 7b076a7 commit cfa0383

7 files changed

Lines changed: 24 additions & 20 deletions

File tree

instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraTelemetryBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ protected CassandraTelemetryBuilder(OpenTelemetry openTelemetry) {
3232
}
3333

3434
/**
35-
* Sets whether the {@code db.statement} attribute on the spans emitted by the constructed {@link
36-
* CassandraTelemetry} should be sanitized. If set to {@code true}, all parameters that can
37-
* potentially contain sensitive information will be masked. Enabled by default.
35+
* Sets whether the {@code db.statement}/{@code db.query.text} attribute on the spans emitted by
36+
* the constructed {@link CassandraTelemetry} should be sanitized. If set to {@code true}, all
37+
* parameters that can potentially contain sensitive information will be masked. Enabled by
38+
* default.
3839
*/
3940
@CanIgnoreReturnValue
4041
public CassandraTelemetryBuilder setQuerySanitizationEnabled(boolean enabled) {

instrumentation/influxdb-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/influxdb/v2_4/InfluxDbImplInstrumentation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,17 @@ public static InfluxDbScope onEnter(
140140
// write data by UDP protocol, in this way, can't get database name.
141141
: arg0 instanceof Integer ? "" : String.valueOf(arg0);
142142

143-
String operation;
143+
String operationName;
144144
if ("createDatabase".equals(methodName)) {
145-
operation = "CREATE DATABASE";
145+
operationName = "CREATE DATABASE";
146146
} else if ("deleteDatabase".equals(methodName)) {
147-
operation = "DROP DATABASE";
147+
operationName = "DROP DATABASE";
148148
} else {
149-
operation = "WRITE";
149+
operationName = "WRITE";
150150
}
151151

152152
InfluxDbRequest influxDbRequest =
153-
InfluxDbRequest.create(httpUrl.host(), httpUrl.port(), database, operation, null);
153+
InfluxDbRequest.create(httpUrl.host(), httpUrl.port(), database, operationName, null);
154154

155155
if (!instrumenter().shouldStart(parentContext, influxDbRequest)) {
156156
return null;

instrumentation/influxdb-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/influxdb/v2_4/InfluxDbRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public abstract class InfluxDbRequest {
1919
SqlQuerySanitizer.create(AgentCommonConfig.get().isQuerySanitizationEnabled());
2020

2121
public static InfluxDbRequest create(
22-
String host, int port, String namespace, String operation, String sql) {
22+
String host, int port, String namespace, String operationName, String sql) {
2323
SqlQuery sqlQuery = SemconvStability.emitOldDatabaseSemconv() ? sanitizer.sanitize(sql) : null;
2424
SqlQuery sqlQueryWithSummary =
2525
SemconvStability.emitStableDatabaseSemconv() ? sanitizer.sanitizeWithSummary(sql) : null;
2626
return new AutoValue_InfluxDbRequest(
27-
host, port, namespace, operation, sqlQuery, sqlQueryWithSummary);
27+
host, port, namespace, operationName, sqlQuery, sqlQueryWithSummary);
2828
}
2929

3030
public abstract String getHost();

instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTelemetryBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public final class LettuceTelemetryBuilder {
2424
}
2525

2626
/**
27-
* Sets whether the {@code db.statement} attribute on the spans emitted by the constructed {@link
28-
* LettuceTelemetry} should be sanitized. If set to {@code true}, all parameters that can
29-
* potentially contain sensitive information will be masked. Enabled by default.
27+
* Sets whether the {@code db.statement}/{@code db.query.text} attribute on the spans emitted by
28+
* the constructed {@link LettuceTelemetry} should be sanitized. If set to {@code true}, all
29+
* parameters that can potentially contain sensitive information will be masked. Enabled by
30+
* default.
3031
*/
3132
@CanIgnoreReturnValue
3233
public LettuceTelemetryBuilder setQuerySanitizationEnabled(boolean querySanitizationEnabled) {

instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private void fillEndpoint(OpenTelemetryEndpoint endpoint) {
271271
@CanIgnoreReturnValue
272272
@SuppressWarnings({"UnusedMethod", "EffectivelyPrivate"})
273273
public synchronized Tracer.Span start(RedisCommand<?, ?, ?> command) {
274-
// Extract args BEFORE calling start() so db.statement can include them
274+
// Extract args BEFORE calling start() so db.query.text can include them
275275
// when it's set on SpanBuilder (making it available to samplers)
276276
if (command.getArgs() != null) {
277277
argsList = OtelCommandArgsUtil.getCommandArgs(command.getArgs());

instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetryBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ public final class MongoTelemetryBuilder {
2626
}
2727

2828
/**
29-
* Sets whether the {@code db.statement} attribute on the spans emitted by the constructed {@link
30-
* MongoTelemetry} should be sanitized. If set to {@code true}, all parameters that can
31-
* potentially contain sensitive information will be masked. Enabled by default.
29+
* Sets whether the {@code db.statement}/{@code db.query.text} attribute on the spans emitted by
30+
* the constructed {@link MongoTelemetry} should be sanitized. If set to {@code true}, all
31+
* parameters that can potentially contain sensitive information will be masked. Enabled by
32+
* default.
3233
*/
3334
@CanIgnoreReturnValue
3435
public MongoTelemetryBuilder setQuerySanitizationEnabled(boolean querySanitizationEnabled) {

instrumentation/r2dbc-1.0/library/src/main/java/io/opentelemetry/instrumentation/r2dbc/v1_0/R2dbcTelemetryBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ public R2dbcTelemetryBuilder addAttributesExtractor(
4141
}
4242

4343
/**
44-
* Sets whether the {@code db.statement} attribute on the spans emitted by the constructed {@link
45-
* R2dbcTelemetry} should be sanitized. If set to {@code true}, all parameters that can
46-
* potentially contain sensitive information will be masked. Enabled by default.
44+
* Sets whether the {@code db.statement}/{@code db.query.text} attribute on the spans emitted by
45+
* the constructed {@link R2dbcTelemetry} should be sanitized. If set to {@code true}, all
46+
* parameters that can potentially contain sensitive information will be masked. Enabled by
47+
* default.
4748
*/
4849
@CanIgnoreReturnValue
4950
public R2dbcTelemetryBuilder setQuerySanitizationEnabled(boolean enabled) {

0 commit comments

Comments
 (0)