Skip to content

Commit 429ad65

Browse files
committed
PR comments addressed
1 parent d5bb920 commit 429ad65

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

docs/supported-libraries.md

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ These are the supported libraries and frameworks:
158158
| [Vibur DBCP](https://www.vibur.org/) | 11.0+ | [opentelemetry-vibur-dbcp-11.0](../instrumentation/vibur-dbcp-11.0/library) | [Database Pool Metrics] |
159159
| [XXL-JOB](https://www.xuxueli.com/xxl-job/en/) | 1.9.2+ | N/A | none |
160160
| [ZIO](https://zio.dev/) | 2.0+ | N/A | Context propagation |
161+
| [ActiveJ](https://activej.io/) | 6.0+ | N/A | [HTTP Server Spans] |
161162

162163
**[1]** Standalone library instrumentation refers to instrumentation that can be used without the Java agent.
163164

instrumentation/activej-http-6.0/javaagent/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ muzzle {
66
pass {
77
group.set("io.activej:activej-http")
88
module.set("activej-http")
9-
109
versions.set("[6.0,)")
1110
assertInverse.set(true)
1211
}

instrumentation/activej-http-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/activejhttp/ActivejHttpServerConnectionSingletons.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
1111
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpServerInstrumenters;
1212

13-
public class ActivejHttpServerConnectionSingletons {
13+
public final class ActivejHttpServerConnectionSingletons {
1414

1515
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.activej-http-6.0";
1616

instrumentation/activej-http-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/activejhttp/ActivejHttpServerHeaders.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
import java.util.Iterator;
1515
import java.util.List;
1616
import java.util.Map;
17-
import java.util.stream.Collectors;
1817

1918
enum ActivejHttpServerHeaders implements ExtendedTextMapGetter<HttpRequest> {
2019
INSTANCE;
2120

2221
@Override
2322
public Iterable<String> keys(HttpRequest httpRequest) {
24-
return httpRequest.getHeaders().stream()
25-
.map(h -> h.getKey().toString())
26-
.collect(Collectors.toList());
23+
return httpRequest.getHeaders().stream().map(h -> h.getKey().toString()).toList();
2724
}
2825

2926
@Override

instrumentation/activej-http-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/activejhttp/ActivejHttpServerUtil.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66
package io.opentelemetry.javaagent.instrumentation.activejhttp;
77

8-
import io.activej.http.HttpError;
8+
import static io.activej.http.HttpError.internalServerError500;
9+
import static java.util.Collections.emptyList;
10+
911
import io.activej.http.HttpHeaders;
1012
import io.activej.http.HttpRequest;
1113
import io.activej.http.HttpResponse;
1214
import io.activej.http.HttpVersion;
1315
import java.util.Arrays;
14-
import java.util.Collections;
1516
import java.util.List;
1617
import java.util.stream.Collectors;
1718
import javax.annotation.Nullable;
@@ -29,15 +30,15 @@ static String getHttpRequestMethod(HttpRequest request) {
2930
static List<String> requestHeader(HttpRequest request, String name) {
3031
String headerValue = request.getHeader(HttpHeaders.of(name));
3132
if (headerValue == null) {
32-
return Collections.emptyList();
33+
return emptyList();
3334
}
3435
return Arrays.stream(headerValue.split(",")).collect(Collectors.toList());
3536
}
3637

3738
static Integer getHttpResponseStatusCode(
3839
HttpRequest request, HttpResponse httpResponse, @Nullable Throwable error) {
3940
if (error != null && httpResponse.getCode() <= 0) {
40-
return HttpError.internalServerError500().getCode();
41+
return internalServerError500().getCode();
4142
}
4243
return httpResponse.getCode();
4344
}
@@ -46,7 +47,7 @@ static List<String> getHttpResponseHeader(
4647
HttpRequest request, HttpResponse httpResponse, String name) {
4748
String headerValue = httpResponse.getHeader(HttpHeaders.of(name));
4849
if (headerValue == null) {
49-
return Collections.emptyList();
50+
return emptyList();
5051
}
5152
return Arrays.stream(headerValue.split(",")).toList();
5253
}

0 commit comments

Comments
 (0)