Skip to content

Commit 9c996de

Browse files
authored
Rename servlet instrumentation classes (#317)
* Rename servlet instrumentation classes Signed-off-by: Pavol Loffay <[email protected]> * Fix Signed-off-by: Pavol Loffay <[email protected]>
1 parent cbee12f commit 9c996de

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.hypertrace.agent.core.instrumentation.utils.ContentTypeUtils;
5959
import org.hypertrace.agent.filter.FilterRegistry;
6060

61-
public class Servlet31NoWrappingInstrumentation implements TypeInstrumentation {
61+
public class Servlet30AndFilterInstrumentation implements TypeInstrumentation {
6262

6363
@Override
6464
public ElementMatcher<ClassLoader> classLoaderOptimization() {
@@ -78,7 +78,7 @@ public Map<? extends ElementMatcher<? super MethodDescription>, String> transfor
7878
.and(takesArgument(0, named("javax.servlet.ServletRequest")))
7979
.and(takesArgument(1, named("javax.servlet.ServletResponse")))
8080
.and(isPublic()),
81-
Servlet31NoWrappingInstrumentation.class.getName() + "$ServletAdvice");
81+
Servlet30AndFilterInstrumentation.class.getName() + "$ServletAdvice");
8282
return matchers;
8383
}
8484

@@ -90,7 +90,7 @@ public static boolean start(
9090
@Advice.Local("currentSpan") Span currentSpan) {
9191

9292
int callDepth =
93-
CallDepthThreadLocalMap.incrementCallDepth(Servlet31InstrumentationName.class);
93+
CallDepthThreadLocalMap.incrementCallDepth(Servlet30InstrumentationName.class);
9494
if (callDepth > 0) {
9595
return false;
9696
}
@@ -143,7 +143,7 @@ public static void exit(
143143
@Advice.Argument(1) ServletResponse response,
144144
@Advice.Local("currentSpan") Span currentSpan) {
145145
int callDepth =
146-
CallDepthThreadLocalMap.decrementCallDepth(Servlet31InstrumentationName.class);
146+
CallDepthThreadLocalMap.decrementCallDepth(Servlet30InstrumentationName.class);
147147
if (callDepth > 0) {
148148
return;
149149
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import java.util.List;
2828

2929
@AutoService(InstrumentationModule.class)
30-
public class Servlet31NoWrappingInstrumentationModule extends InstrumentationModule {
30+
public class Servlet30InstrumentationModule extends InstrumentationModule {
3131

32-
public Servlet31NoWrappingInstrumentationModule() {
33-
super(Servlet31InstrumentationName.PRIMARY, Servlet31InstrumentationName.OTHER);
32+
public Servlet30InstrumentationModule() {
33+
super(Servlet30InstrumentationName.PRIMARY, Servlet30InstrumentationName.OTHER);
3434
}
3535

3636
@Override
@@ -41,7 +41,7 @@ public int getOrder() {
4141
@Override
4242
public List<TypeInstrumentation> typeInstrumentations() {
4343
return Arrays.asList(
44-
new Servlet31NoWrappingInstrumentation(),
44+
new Servlet30AndFilterInstrumentation(),
4545
new ServletRequestInstrumentation(),
4646
new ServletInputStreamInstrumentation(),
4747
new ServletResponseInstrumentation(),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.opentelemetry.javaagent.instrumentation.hypertrace.servlet.v3_0.nowrapping;
1818

19-
public class Servlet31InstrumentationName {
19+
public class Servlet30InstrumentationName {
2020
public static final String PRIMARY = "servlet";
2121
public static final String[] OTHER = {
2222
"servlet-3",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import org.junit.jupiter.api.BeforeAll;
4646
import org.junit.jupiter.api.Test;
4747

48-
public class Servlet30NoWrappingInstrumentationTest extends AbstractInstrumenterTest {
48+
public class Servlet30InstrumentationTest extends AbstractInstrumenterTest {
4949
private static final String REQUEST_BODY = "hello";
5050
private static final String REQUEST_HEADER = "requestheader";
5151
private static final String REQUEST_HEADER_VALUE = "requestvalue";

0 commit comments

Comments
 (0)