Skip to content

Commit 63485ae

Browse files
otelbot[bot]trask
andauthored
Code review sweep (run 25222958420) (#18490)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
1 parent a8887a2 commit 63485ae

9 files changed

Lines changed: 28 additions & 26 deletions

File tree

instrumentation/ratpack/ratpack-1.4/testing/src/main/java/io/opentelemetry/instrumentation/ratpack/server/AbstractRatpackRoutesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
4949
public abstract class AbstractRatpackRoutesTest {
5050

51-
private static RatpackServer app;
52-
private static WebClient client;
51+
private RatpackServer app;
52+
private WebClient client;
5353

5454
protected abstract InstrumentationExtension testing();
5555

instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/internal/RatpackHttpClientAttributesGetter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
final class RatpackHttpClientAttributesGetter
2121
implements HttpClientAttributesGetter<RequestSpec, HttpResponse> {
2222

23-
@Nullable
2423
@Override
2524
public String getUrlFull(RequestSpec requestSpec) {
2625
return requestSpec.getUri().toString();
2726
}
2827

29-
@Nullable
3028
@Override
3129
public String getHttpRequestMethod(RequestSpec requestSpec) {
3230
return requestSpec.getMethod().getName();

instrumentation/ratpack/ratpack-1.7/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ configurations:
6666
type: boolean
6767
default: false
6868
- name: otel.instrumentation.sanitization.url.experimental.sensitive-query-parameters
69+
declarative_name: general.sanitization.url.sensitive_query_parameters/development
6970
description: List of URL query parameter names whose values are redacted in URL attributes. See https://opentelemetry.io/docs/specs/semconv/http/http-spans.
7071
type: list
7172
default: "AWSAccessKeyId,Signature,sig,X-Goog-Signature"

instrumentation/reactor/reactor-3.1/library/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
dependencies {
66
// we compile against 3.4.0, so we could use reactor.util.context.ContextView
7-
// instrumentation is expected it to work with 3.1.0.RELEASE
7+
// instrumentation is expected to work with 3.1.0.RELEASE
88
compileOnly("io.projectreactor:reactor-core:3.4.0")
99
compileOnly(project(":muzzle")) // For @NoMuzzle
1010
implementation(project(":instrumentation-annotations-support"))

instrumentation/reactor/reactor-3.1/library/src/main/java/io/opentelemetry/instrumentation/reactor/v3_1/ContextPropagationOperator.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,31 @@ public final class ContextPropagationOperator {
6565
@Nullable
6666
private static final MethodHandle SCHEDULERS_RESET_HOOK_METHOD = getSchedulersResetHookMethod();
6767

68+
private static final Object TRACE_CONTEXT_KEY =
69+
new Object() {
70+
@Override
71+
public String toString() {
72+
return "otel-trace-context";
73+
}
74+
};
75+
76+
private static final Object lock = new Object();
77+
78+
private static volatile boolean enabled = false;
79+
80+
private final ReactorAsyncOperationEndStrategy asyncOperationEndStrategy;
81+
6882
@Nullable
6983
private static MethodHandle getContextWriteMethod(Class<?> type) {
7084
MethodHandles.Lookup lookup = MethodHandles.publicLookup();
7185
try {
7286
return lookup.findVirtual(type, "contextWrite", methodType(type, Function.class));
73-
} catch (NoSuchMethodException | IllegalAccessException e) {
87+
} catch (NoSuchMethodException | IllegalAccessException ignored) {
7488
// ignore
7589
}
7690
try {
7791
return lookup.findVirtual(type, "subscriberContext", methodType(type, Function.class));
78-
} catch (NoSuchMethodException | IllegalAccessException e) {
92+
} catch (NoSuchMethodException | IllegalAccessException ignored) {
7993
// ignore
8094
}
8195
return null;
@@ -87,7 +101,7 @@ private static MethodHandle getSchedulersHookMethod() {
87101
try {
88102
return lookup.findStatic(
89103
Schedulers.class, "onScheduleHook", methodType(void.class, String.class, Function.class));
90-
} catch (NoSuchMethodException | IllegalAccessException e) {
104+
} catch (NoSuchMethodException | IllegalAccessException ignored) {
91105
// ignore
92106
}
93107
return null;
@@ -99,7 +113,7 @@ private static MethodHandle getSchedulersResetHookMethod() {
99113
try {
100114
return lookup.findStatic(
101115
Schedulers.class, "resetOnScheduleHook", methodType(void.class, String.class));
102-
} catch (NoSuchMethodException | IllegalAccessException e) {
116+
} catch (NoSuchMethodException | IllegalAccessException ignored) {
103117
// ignore
104118
}
105119
return null;
@@ -113,20 +127,6 @@ public static ContextPropagationOperatorBuilder builder() {
113127
return new ContextPropagationOperatorBuilder();
114128
}
115129

116-
private final ReactorAsyncOperationEndStrategy asyncOperationEndStrategy;
117-
118-
private static final Object TRACE_CONTEXT_KEY =
119-
new Object() {
120-
@Override
121-
public String toString() {
122-
return "otel-trace-context";
123-
}
124-
};
125-
126-
private static final Object lock = new Object();
127-
128-
private static volatile boolean enabled = false;
129-
130130
/**
131131
* Stores Trace {@link io.opentelemetry.context.Context} in Reactor {@link
132132
* reactor.util.context.Context}.

instrumentation/reactor/reactor-3.1/library/src/test/java/io/opentelemetry/instrumentation/reactor/v3_1/HooksTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private static boolean schedulerHooksSupported() {
110110
Schedulers.class.getMethod("onScheduleHook", String.class, Function.class);
111111
Schedulers.class.getMethod("resetOnScheduleHook", String.class);
112112
return true;
113-
} catch (NoSuchMethodException e) {
113+
} catch (NoSuchMethodException ignored) {
114114
return false;
115115
}
116116
}

instrumentation/reactor/reactor-3.1/library/src/test/java/io/opentelemetry/instrumentation/reactor/v3_1/ReactorCoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static MethodHandle getContextWriteMethod(Class<?> type) {
5454
MethodHandles.Lookup lookup = MethodHandles.publicLookup();
5555
try {
5656
return lookup.findVirtual(type, "contextWrite", methodType(type, Function.class));
57-
} catch (NoSuchMethodException | IllegalAccessException e) {
57+
} catch (NoSuchMethodException | IllegalAccessException ignored) {
5858
// ignore
5959
}
6060
try {

instrumentation/reactor/reactor-3.4/javaagent/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies {
2626
testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
2727
testInstrumentation(project(":instrumentation:opentelemetry-extension-annotations-1.0:javaagent"))
2828

29-
testLibrary("io.projectreactor:reactor-test:3.1.0.RELEASE")
3029
testImplementation(project(":instrumentation-annotations-support-testing"))
3130
testImplementation(project(":instrumentation:reactor:reactor-3.1:testing"))
3231
testImplementation(project(":instrumentation-annotations"))

instrumentation/reactor/reactor-kafka-1.0/javaagent/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ tasks {
106106
test {
107107
systemProperty("hasConsumerGroup", otelProps.testLatestDeps)
108108
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
109+
systemProperty(
110+
"metadataConfig",
111+
"otel.instrumentation.messaging.experimental.receive-telemetry.enabled=true",
112+
)
109113
}
110114

111115
check {

0 commit comments

Comments
 (0)