Skip to content

Commit

Permalink
chore: deprecate opentracing
Browse files Browse the repository at this point in the history
  • Loading branch information
welschsn committed Jan 3, 2024
1 parent f45cdbd commit 132907f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import java.util.function.Function;

/**
* Parameter annotation used on methods annotated with {@link TraceInvocation} used to indicate that the
* given method parameter should used as the value of a span tag.
* Parameter annotation used on methods annotated with {@link TraceInvocation} used to indicate that
* the given method parameter should be used as the value of a span tag.
*
* @deprecated as of 1.14.0, in favor of OpenTelemetry and
* {@link com.neverpile.common.opentelemetry.Attribute}
*/
@Deprecated(
since = "1.14.0")
@Target({
ElementType.PARAMETER, ElementType.ANNOTATION_TYPE
})
Expand All @@ -25,31 +30,34 @@ public Object apply(final Object t) {

/**
* The name of the tag for a traced parameter.
*
* @return The name of the tag.
*/
String name() default "";

/**
* An optional implementation of a {@link Function} used to map from the argument value to the tag
* value.
*
* @return Function to map a non standard value for tracing.
*/
Class<? extends Function<? extends Object, ? extends Object>> valueAdapter() default NoopMapper.class;

public interface TagExtractor<V> {
public void extract(V value, BiConsumer<String, Object> tagCreator);
}

public static class NoopExtractor implements TagExtractor<Object> {
@Override
public void extract(final Object value, final BiConsumer<String, Object> t) {
// just a dummy
}
}

/**
* An optional implementation of a {@link Function} used to map from the argument value to the tag
* value.
*
* @return Function to map a non standard value for tracing.
*/
Class<? extends TagExtractor<?>> tagExtractor() default NoopExtractor.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
/**
* Annotation used on methods to indicate that a new opentracing span should be created around the
* method invocation. Span tags can be assigned from method parameters using {@link Tag}
*
* @deprecated as of 1.14.0, in favor of OpenTelemetry and
* {@link com.neverpile.common.opentelemetry.TraceInvocation}
*/
@Deprecated(
since = "1.14.0")
@Target({
ElementType.METHOD, ElementType.ANNOTATION_TYPE
})
Expand Down

0 comments on commit 132907f

Please sign in to comment.