Skip to content

Commit 8673767

Browse files
Merge branch 'main' into add_metric_annotation_instrument
2 parents 603c597 + 09e2ff0 commit 8673767

File tree

82 files changed

+933
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+933
-406
lines changed

custom-checks/src/main/java/com/google/errorprone/bugpatterns/checkreturnvalue/CanIgnoreReturnValueSuggesterFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
package com.google.errorprone.bugpatterns.checkreturnvalue;
77

88
import com.google.errorprone.ErrorProneFlags;
9+
import com.google.errorprone.bugpatterns.WellKnownKeep;
910

1011
public final class CanIgnoreReturnValueSuggesterFactory {
1112

1213
// calls package private constructor of CanIgnoreReturnValueSuggester
1314
public static CanIgnoreReturnValueSuggester createCanIgnoreReturnValueSuggester(
14-
ErrorProneFlags errorProneFlags) {
15-
return new CanIgnoreReturnValueSuggester(errorProneFlags);
15+
ErrorProneFlags errorProneFlags, WellKnownKeep wellKnownKeep) {
16+
return new CanIgnoreReturnValueSuggester(errorProneFlags, wellKnownKeep);
1617
}
1718

1819
private CanIgnoreReturnValueSuggesterFactory() {}

custom-checks/src/main/java/io/opentelemetry/javaagent/customchecks/OtelCanIgnoreReturnValueSuggester.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.google.errorprone.ErrorProneFlags;
1313
import com.google.errorprone.VisitorState;
1414
import com.google.errorprone.bugpatterns.BugChecker;
15+
import com.google.errorprone.bugpatterns.WellKnownKeep;
1516
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggester;
1617
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggesterFactory;
1718
import com.google.errorprone.matchers.Description;
@@ -33,9 +34,10 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
3334
private final CanIgnoreReturnValueSuggester delegate;
3435

3536
@Inject
36-
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags) {
37+
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags, WellKnownKeep wellKnownKeep) {
3738
delegate =
38-
CanIgnoreReturnValueSuggesterFactory.createCanIgnoreReturnValueSuggester(errorProneFlags);
39+
CanIgnoreReturnValueSuggesterFactory.createCanIgnoreReturnValueSuggester(
40+
errorProneFlags, wellKnownKeep);
3941
}
4042

4143
public OtelCanIgnoreReturnValueSuggester() {

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ val DEPENDENCY_BOMS = listOf(
3838

3939
val autoServiceVersion = "1.1.1"
4040
val autoValueVersion = "1.11.0"
41-
val errorProneVersion = "2.40.0"
41+
val errorProneVersion = "2.41.0"
4242
val byteBuddyVersion = "1.17.6"
4343
val asmVersion = "9.8"
4444
val jmhVersion = "1.37"

docs/advanced-configuration-options.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ this option if your application relies on security manager to run untrusted code
3939

4040
## JavaScript snippet injection
4141

42-
This experimental feature allows you to inject JavaScript code into HTML responses from servlet applications. The agent will look for the `</head>` tag in HTML responses, and inject the configured JavaScript snippet before the closing `</head>` tag.
42+
This experimental feature allows you to inject JavaScript code into HTML responses from servlet applications. The agent will look for the `<head>` tag in HTML responses, and inject the configured JavaScript snippet after it.
4343

4444
This feature is designed for integrating client-side monitoring.
4545
We plan to integrate OpenTelemetry's own client-side monitoring solution by default once it's available
4646
(see the [browser instrumentation proposal](https://github.com/open-telemetry/community/blob/main/projects/browser-phase-1.md)).
4747

48-
| System property | Environment variable | Purpose |
49-
|--------------------------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
50-
| otel.experimental.javascript-snippet | OTEL_EXPERIMENTAL_JAVASCRIPT_SNIPPET | JavaScript code to inject into HTML responses before the closing `</head>` tag. The value should be a complete JavaScript snippet including `<script>` tags if needed, e.g. `-Dotel.experimental.javascript-snippet="<script>console.log('Hello world!');</script>"` |
48+
| System property | Environment variable | Purpose |
49+
|--------------------------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
50+
| otel.experimental.javascript-snippet | OTEL_EXPERIMENTAL_JAVASCRIPT_SNIPPET | Experimental setting to inject a JavaScript snippet into HTML responses after the opening `<head>` tag. The value should be a complete JavaScript snippet including `<script>` tags if needed, e.g. `-Dotel.experimental.javascript-snippet="<script>console.log('Hello world!');</script>"` |
5151

5252
**Important notes:**
5353

5454
- This only works with servlet-based applications currently
55-
- The snippet is injected only into HTML responses that contain a `</head>` tag
55+
- The snippet is injected only into HTML responses that contain a `<head>` tag
5656
- The agent will attempt to preserve the original character encoding of the response
5757
- If the response already has a `Content-Length` header, it will be updated to reflect the additional content

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/ContextPropagationDebug.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ private static void debugContextPropagation(Context context) {
139139
}
140140

141141
private static class Propagation {
142-
public final String carrierClassName;
143-
public final StackTraceElement[] location;
142+
final String carrierClassName;
143+
final StackTraceElement[] location;
144144

145-
public Propagation(String carrierClassName, StackTraceElement[] location) {
145+
Propagation(String carrierClassName, StackTraceElement[] location) {
146146
this.carrierClassName = carrierClassName;
147147
this.location = location;
148148
}

instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaFlowWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public GraphStageLogic createLogic(Attributes attributes) {
7373
private class TracingLogic extends GraphStageLogic {
7474
private final Deque<TracingRequest> requests = new ArrayDeque<>();
7575

76-
public TracingLogic() {
76+
TracingLogic() {
7777
super(shape);
7878

7979
// server pulls response, pass response from user code to server

instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) {
211211
private static class HttpResponseHandler implements ResponseHandler<Void> {
212212
private final HttpClientResult requestResult;
213213

214-
public HttpResponseHandler(HttpClientResult requestResult) {
214+
HttpResponseHandler(HttpClientResult requestResult) {
215215
this.requestResult = requestResult;
216216
}
217217

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpAsyncClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void executeRequestWithCallback(SimpleHttpRequest request, URI uri, HttpClientRe
127127
private static class ResponseCallback implements FutureCallback<SimpleHttpResponse> {
128128
private final HttpClientResult httpClientResult;
129129

130-
public ResponseCallback(HttpClientResult httpClientResult) {
130+
ResponseCallback(HttpClientResult httpClientResult) {
131131
this.httpClientResult = httpClientResult;
132132
}
133133

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) {
234234
private static class ResponseHandler implements HttpClientResponseHandler<Void> {
235235
private final HttpClientResult httpClientResult;
236236

237-
public ResponseHandler(HttpClientResult httpClientResult) {
237+
ResponseHandler(HttpClientResult httpClientResult) {
238238
this.httpClientResult = httpClientResult;
239239
}
240240

instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/test/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/AwsLambdaWrapperTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ public String handleRequest(Integer input, Context context) {
177177
}
178178
}
179179

180-
@SuppressWarnings("UnusedMethod")
181-
private static class CustomType {
180+
static class CustomType {
182181
String key;
183182
String value;
184183

0 commit comments

Comments
 (0)