Skip to content

Commit cb17b11

Browse files
committed
update based on comment
1 parent f2cc5f0 commit cb17b11

File tree

2 files changed

+6
-7
lines changed
  • instrumentation/logback/logback-access-jetty-12.0/javaagent/src

2 files changed

+6
-7
lines changed

instrumentation/logback/logback-access-jetty-12.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/logback/access/jetty/v12_0/AccessEventMapper.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ public class AccessEventMapper {
2121

2222
public static final String ACCESS_EVENT_NAME = "access-event";
2323

24-
@SuppressWarnings({"MethodCanBeStatic", "EmptyCatch"})
25-
// MethodCanBeStatic: This method should eventually refer to configs in this class. So it should
26-
// not be static.
27-
// EmptyCatch: for parsing URI, the input itself is actually one URI, so there is low chance the
28-
// exception would be thrown. Even when it actually happened, there is not much we can do here.
29-
private void mapLoggingEvent(LogRecordBuilder builder, IAccessEvent accessEvent) {
24+
private static void mapLoggingEvent(LogRecordBuilder builder, IAccessEvent accessEvent) {
3025
URI uri = null;
3126
try {
3227
uri = new URI(accessEvent.getRequest().getRequestURL().toString());
3328
} catch (URISyntaxException ignored) {
29+
// ignore
30+
// for parsing URI, the input itself is actually one URI, so there is low chance the
31+
// exception would be thrown. Even when it actually happened, there is not much we can do
32+
// here.
3433
}
3534

3635
builder

instrumentation/logback/logback-access-jetty-12.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/logback/access/jetty/v12_0/TestAccessLogWithJetty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void stopServer() throws Exception {
5555
AgentInstrumentationExtension.create();
5656

5757
@Test
58-
void testT() throws IOException {
58+
void testJettyServerAccessLog() throws IOException {
5959
String path = "12312321";
6060
URL url = new URL("http://localhost:" + RANDOM_SERVER_PORT + "/" + path);
6161
HttpURLConnection connection = (HttpURLConnection) url.openConnection();

0 commit comments

Comments
 (0)