Skip to content

Commit 218f603

Browse files
otelbot[bot]trask
andauthored
Code review sweep (run 24871753530) (open-telemetry#18254)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
1 parent 132aa31 commit 218f603

8 files changed

Lines changed: 25 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
public final class OpenTelemetryExecInitializer implements ExecInitializer {
1616
public static final ExecInitializer INSTANCE = new OpenTelemetryExecInitializer();
1717

18+
private OpenTelemetryExecInitializer() {}
19+
1820
@Override
1921
public void init(Execution execution) {
2022
// Propagates ContextHolder to child execution because the response interceptor is triggered in

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public final class OpenTelemetryExecInterceptor implements ExecInterceptor {
1919

2020
public static final ExecInterceptor INSTANCE = new OpenTelemetryExecInterceptor();
2121

22+
private OpenTelemetryExecInterceptor() {}
23+
2224
@Override
2325
public void intercept(Execution execution, ExecType type, Block continuation) throws Exception {
2426
Context otelCtx = execution.maybeGet(Context.class).orElse(null);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class OpenTelemetryFallbackErrorHandler implements ClientErrorHandler, Ser
4343
private static final Logger logger =
4444
Logger.getLogger(OpenTelemetryFallbackErrorHandler.class.getName());
4545

46-
OpenTelemetryFallbackErrorHandler() {}
46+
private OpenTelemetryFallbackErrorHandler() {}
4747

4848
@Override
4949
public void error(Context context, int statusCode) {

instrumentation/ratpack/ratpack-1.7/metadata.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,42 @@ features:
1414
library_link: https://ratpack.io/
1515
configurations:
1616
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
17+
declarative_name: java.common.controller_telemetry/development.enabled
1718
description: Enables the creation of experimental controller spans.
1819
type: boolean
1920
default: false
2021
- name: otel.instrumentation.http.server.capture-request-headers
22+
declarative_name: general.http.server.request_captured_headers
2123
description: List of HTTP request headers to capture in HTTP server telemetry.
2224
type: list
2325
default: ""
2426
- name: otel.instrumentation.http.server.capture-response-headers
27+
declarative_name: general.http.server.response_captured_headers
2528
description: List of HTTP response headers to capture in HTTP server telemetry.
2629
type: list
2730
default: ""
2831
- name: otel.instrumentation.http.server.emit-experimental-telemetry
32+
declarative_name: java.common.http.server.emit_experimental_telemetry/development
2933
description: >
3034
Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size`
3135
and `http.response.body.size` attributes to spans, and records `http.server.request.size` and
3236
`http.server.response.size` metrics.
3337
type: boolean
3438
default: false
3539
- name: otel.instrumentation.http.known-methods
40+
declarative_name: java.common.http.known_methods
3641
description: >
3742
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
3843
other methods will be treated as `_OTHER`.
3944
type: list
4045
default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE"
4146
- name: otel.instrumentation.http.client.capture-request-headers
47+
declarative_name: general.http.client.request_captured_headers
4248
description: List of HTTP request headers to capture in HTTP client telemetry.
4349
type: list
4450
default: ""
4551
- name: otel.instrumentation.http.client.capture-response-headers
52+
declarative_name: general.http.client.response_captured_headers
4653
description: List of HTTP response headers to capture in HTTP client telemetry.
4754
type: list
4855
default: ""
@@ -51,13 +58,15 @@ configurations:
5158
type: map
5259
default: ""
5360
- name: otel.instrumentation.http.client.emit-experimental-telemetry
61+
declarative_name: java.common.http.client.emit_experimental_telemetry/development
5462
description: >
5563
Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size`
5664
and `http.response.body.size` attributes to spans, and records `http.client.request.size` and
5765
`http.client.response.size` metrics.
5866
type: boolean
5967
default: false
6068
- name: otel.instrumentation.http.client.experimental.redact-query-parameters
69+
declarative_name: java.common.http.client.redact_query_parameters/development
6170
description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans.
6271
type: boolean
63-
default: true
72+
default: true

instrumentation/reactor/reactor-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactor/v3_1/ContextPropagationOperatorInstrumentationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ void storeContextForcesItToBecomeCurrent() {
176176
(Mono<String>)
177177
MONO_CONTEXT_WRITE_METHOD.invoke(
178178
interim, new StoreOpenTelemetryContext(span));
179-
} catch (Throwable e) {
180-
throw new RuntimeException(e);
179+
} catch (Throwable t) {
180+
throw new RuntimeException(t);
181181
}
182182
return interim.doFinally(unused -> span.end());
183183
});

instrumentation/reactor/reactor-3.1/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ features:
77
library_link: https://projectreactor.io/
88
configurations:
99
- name: otel.instrumentation.reactor.experimental-span-attributes
10+
declarative_name: java.reactor.experimental_span_attributes/development
1011
description: >
1112
Enables the capture of the experimental `reactor.canceled` attribute on spans when reactive
1213
streams are cancelled.

instrumentation/reactor/reactor-kafka-1.0/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ semantic_conventions:
66
library_link: https://projectreactor.io/docs/kafka/release/reference/
77
configurations:
88
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled
9+
declarative_name: java.common.messaging.receive_telemetry/development.enabled
910
description: >
1011
Enables experimental receive telemetry, which will cause consumers to start a new trace, with
1112
only a span link connecting it to the producer trace.
1213
type: boolean
1314
default: false
1415
- name: otel.instrumentation.messaging.experimental.capture-headers
16+
declarative_name: java.common.messaging.capture_headers/development
1517
description: >
1618
Enables capturing messaging headers as span attributes. Provide a comma-separated list of
1719
header names to capture.
1820
type: list
1921
default: ''
2022
- name: otel.instrumentation.kafka.experimental-span-attributes
23+
declarative_name: java.kafka.experimental_span_attributes/development
2124
description: Enables the capture of the experimental consumer attribute `kafka.record.queue_time_ms`.
2225
type: boolean
2326
default: false

instrumentation/reactor/reactor-kafka-1.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/reactor/kafka/v1_0/AbstractReactorKafkaTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public abstract class AbstractReactorKafkaTest {
7373

7474
@RegisterExtension static final AutoCleanupExtension cleanup = AutoCleanupExtension.create();
7575

76-
static KafkaContainer kafka;
76+
private static KafkaContainer kafka;
7777
protected static KafkaSender<String, String> sender;
7878
protected static KafkaReceiver<String, String> receiver;
7979

@@ -207,7 +207,7 @@ private static void assertWithoutReceiveTelemetry(SenderRecord<String, String, O
207207
}
208208

209209
@SuppressWarnings("deprecation") // using deprecated semconv
210-
protected static List<AttributeAssertion> sendAttributes(ProducerRecord<String, String> record) {
210+
private static List<AttributeAssertion> sendAttributes(ProducerRecord<String, String> record) {
211211
List<AttributeAssertion> assertions =
212212
new ArrayList<>(
213213
asList(
@@ -229,7 +229,7 @@ protected static List<AttributeAssertion> sendAttributes(ProducerRecord<String,
229229
}
230230

231231
@SuppressWarnings("deprecation") // using deprecated semconv
232-
protected static List<AttributeAssertion> receiveAttributes(String topic) {
232+
private static List<AttributeAssertion> receiveAttributes(String topic) {
233233
ArrayList<AttributeAssertion> assertions =
234234
new ArrayList<>(
235235
asList(
@@ -245,8 +245,7 @@ protected static List<AttributeAssertion> receiveAttributes(String topic) {
245245
}
246246

247247
@SuppressWarnings("deprecation") // using deprecated semconv
248-
protected static List<AttributeAssertion> processAttributes(
249-
ProducerRecord<String, String> record) {
248+
private static List<AttributeAssertion> processAttributes(ProducerRecord<String, String> record) {
250249
List<AttributeAssertion> assertions =
251250
new ArrayList<>(
252251
asList(

0 commit comments

Comments
 (0)