20
20
import com .datastax .driver .core .policies .LoadBalancingPolicy ;
21
21
import com .datastax .driver .core .policies .RetryPolicy ;
22
22
import com .datastax .driver .core .policies .SpeculativeExecutionPolicy ;
23
- import com .datastax .driver .core .tracing .PrecisionLevel ;
24
23
import com .datastax .driver .core .tracing .TracingInfo ;
24
+ import com .datastax .driver .core .tracing .VerbosityLevel ;
25
25
import io .opentelemetry .api .trace .Span ;
26
26
import io .opentelemetry .api .trace .Tracer ;
27
27
import io .opentelemetry .context .Context ;
@@ -32,9 +32,9 @@ public class OpenTelemetryTracingInfo implements TracingInfo {
32
32
private final Tracer tracer ;
33
33
private final Context context ;
34
34
private boolean tracingStarted ;
35
- private final PrecisionLevel precision ;
35
+ private final VerbosityLevel precision ;
36
36
37
- protected OpenTelemetryTracingInfo (Tracer tracer , Context context , PrecisionLevel precision ) {
37
+ protected OpenTelemetryTracingInfo (Tracer tracer , Context context , VerbosityLevel precision ) {
38
38
this .tracer = tracer ;
39
39
this .context = context ;
40
40
this .precision = precision ;
@@ -53,7 +53,7 @@ private void assertStarted() {
53
53
assert tracingStarted : "TracingInfo.setStartTime must be called before any other method" ;
54
54
}
55
55
56
- public PrecisionLevel getPrecision () {
56
+ public VerbosityLevel getVerbosity () {
57
57
return precision ;
58
58
}
59
59
@@ -72,14 +72,14 @@ public void setConsistencyLevel(ConsistencyLevel consistency) {
72
72
73
73
public void setStatement (String statement ) {
74
74
assertStarted ();
75
- if (currentPrecisionLevelIsAtLeast ( PrecisionLevel .FULL )) {
75
+ if (currentVerbosityLevelIsAtLeast ( VerbosityLevel .FULL )) {
76
76
span .setAttribute ("db.scylladb.statement" , statement );
77
77
}
78
78
}
79
79
80
80
public void setHostname (String hostname ) {
81
81
assertStarted ();
82
- if (currentPrecisionLevelIsAtLeast ( PrecisionLevel .FULL )) {
82
+ if (currentVerbosityLevelIsAtLeast ( VerbosityLevel .FULL )) {
83
83
span .setAttribute ("net.peer.name" , hostname );
84
84
}
85
85
}
@@ -168,7 +168,7 @@ public void setRowsCount(int rowsCount) {
168
168
@ Override
169
169
public void setStatement (String statement , int limit ) {
170
170
assertStarted ();
171
- if (currentPrecisionLevelIsAtLeast ( PrecisionLevel .FULL )) {
171
+ if (currentVerbosityLevelIsAtLeast ( VerbosityLevel .FULL )) {
172
172
if (statement .length () > limit ) statement = statement .substring (0 , limit );
173
173
span .setAttribute ("db.scylladb.statement" , statement );
174
174
}
@@ -244,7 +244,7 @@ public void tracingFinished() {
244
244
span .end ();
245
245
}
246
246
247
- private boolean currentPrecisionLevelIsAtLeast ( PrecisionLevel requiredLevel ) {
247
+ private boolean currentVerbosityLevelIsAtLeast ( VerbosityLevel requiredLevel ) {
248
248
return requiredLevel .compareTo (precision ) <= 0 ;
249
249
}
250
250
}
0 commit comments