Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Apr 20, 2021
1 parent ea8d990 commit dfc902c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import test.RestApplication

@RunWith(ArquillianSputnik)
@RunAsClient
class ArquillianRestTest extends AgentInstrumentationSpecification {
abstract class ArquillianRestTest extends AgentInstrumentationSpecification {

static OkHttpClient client = OkHttpUtils.client()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.SpanBuilder;
import io.opentelemetry.context.Context;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.instrumentation.api.servlet.ServletContextPath;
import io.opentelemetry.instrumentation.api.tracer.BaseTracer;
import io.opentelemetry.instrumentation.api.tracer.ServerSpan;
import io.opentelemetry.javaagent.instrumentation.api.ClassHierarchyIterable;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public CxfInstrumentationModule() {
public List<TypeInstrumentation> typeInstrumentations() {
return asList(
new CxfRequestContextInstrumentation(),
new CfxServletControllerInstrumentation(),
new CxfServletControllerInstrumentation(),
new CxfRsHttpListenerInstrumentation());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Collections;
Expand All @@ -23,7 +23,7 @@
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

public class CfxServletControllerInstrumentation implements TypeInstrumentation {
public class CxfServletControllerInstrumentation implements TypeInstrumentation {

@Override
public ElementMatcher<TypeDescription> typeMatcher() {
Expand All @@ -37,7 +37,7 @@ public Map<? extends ElementMatcher<? super MethodDescription>, String> transfor
.and(isPublic())
.and(named("invokeDestination"))
.and(takesArgument(0, named("javax.servlet.http.HttpServletRequest"))),
CfxServletControllerInstrumentation.class.getName() + "$InvokeAdvice");
CxfServletControllerInstrumentation.class.getName() + "$InvokeAdvice");
}

public static class InvokeAdvice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Collections;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge;
import io.opentelemetry.javaagent.instrumentation.api.jaxrs.JaxrsContextPath;
import io.opentelemetry.javaagent.tooling.TypeInstrumentation;
import java.util.Collections;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.api.jaxrs;
package io.opentelemetry.javaagent.instrumentation.api.jaxrs;

import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
* Helper container for storing context path for jax-rs requests. Jax-rs context path is the path
Expand All @@ -15,12 +16,13 @@
* io.opentelemetry.instrumentation.api.servlet.ServletContextPath} jax-rs context path and the Path
* annotation from called method or class.
*/
public class JaxrsContextPath {

public static final ContextKey<String> CONTEXT_KEY =
public final class JaxrsContextPath {
private static final ContextKey<String> CONTEXT_KEY =
ContextKey.named("opentelemetry-jaxrs-context-path-key");

public static Context init(Context context, String path) {
private JaxrsContextPath() {}

public static @Nullable Context init(Context context, String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return null;
}
Expand Down

0 comments on commit dfc902c

Please sign in to comment.