Class HttpServerTracer<REQUEST,RESPONSE,CONNECTION,STORAGE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.tracer.BaseTracer
-
- io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,RESPONSE,CONNECTION,STORAGE>
-
- Type Parameters:
REQUEST- - The specific type for HTTP requestsRESPONSE- - The specific type for HTTP responsesCONNECTION- - The specific type of HTTP connection, used to get peer address information and HTTP flavor.STORAGE- - Implementation specific storage type for attaching/getting the server context. Use Void if your subclass does not have an implementation specific storage need.
@Deprecated public abstract class HttpServerTracer<REQUEST,RESPONSE,CONNECTION,STORAGE> extends BaseTracer
Deprecated.UseInstrumenterand the HTTP semantic convention utilities package instead.Base class for implementing Tracers for HTTP servers. It has 3 types that must be specified by subclasses:
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTEXT_ATTRIBUTEDeprecated.protected static StringUSER_AGENTDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpServerTracer()Deprecated.protectedHttpServerTracer(io.opentelemetry.api.OpenTelemetry openTelemetry)Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract voidattachServerContext(io.opentelemetry.context.Context context, STORAGE storage)Deprecated.Stores given context in the given request-response-loop storage in implementation specific way.protected io.opentelemetry.context.ContextcustomizeContext(io.opentelemetry.context.Context context, REQUEST request)Deprecated.Override in subclass to customize context that is returned bystartSpan.voidend(io.opentelemetry.context.Context context, RESPONSE response)Deprecated.Convenience method.voidend(io.opentelemetry.context.Context context, RESPONSE response, long timestamp)Deprecated.voidendExceptionally(io.opentelemetry.context.Context context, Throwable throwable)Deprecated.Convenience method.voidendExceptionally(io.opentelemetry.context.Context context, Throwable throwable, RESPONSE response)Deprecated.Convenience method.voidendExceptionally(io.opentelemetry.context.Context context, Throwable throwable, RESPONSE response, long timestamp)Deprecated.Ifresponseisnull, thehttp.status_codewill be set to500and theSpanstatus will be set toStatusCode.ERROR.protected abstract Stringflavor(CONNECTION connection, REQUEST request)Deprecated.protected abstract io.opentelemetry.context.propagation.TextMapGetter<REQUEST>getGetter()Deprecated.abstract io.opentelemetry.context.ContextgetServerContext(STORAGE storage)Deprecated.Returns context stored to the given request-response-loop storage byattachServerContext(Context, Object).io.opentelemetry.api.trace.SpangetServerSpan(STORAGE storage)Deprecated.protected abstract Stringhost(REQUEST request)Deprecated.protected booleanisRelativeUrl(String url)Deprecated.protected abstract Stringmethod(REQUEST request)Deprecated.protected voidonConnection(io.opentelemetry.api.trace.SpanBuilder spanBuilder, CONNECTION connection)Deprecated.protected voidonConnectionAndRequest(io.opentelemetry.api.trace.SpanBuilder spanBuilder, CONNECTION connection, REQUEST request)Deprecated.protected voidonRequest(io.opentelemetry.api.trace.SpanBuilder spanBuilder, REQUEST request)Deprecated.protected abstract StringpeerHostIp(CONNECTION connection)Deprecated.protected abstract IntegerpeerPort(CONNECTION connection)Deprecated.protected abstract StringrequestHeader(REQUEST request, String name)Deprecated.protected abstract intresponseStatus(RESPONSE response)Deprecated.protected abstract Stringscheme(REQUEST request)Deprecated.io.opentelemetry.context.ContextstartSpan(REQUEST request, CONNECTION connection, STORAGE storage, Method origin)Deprecated.io.opentelemetry.context.ContextstartSpan(REQUEST request, CONNECTION connection, STORAGE storage, String spanName)Deprecated.io.opentelemetry.context.ContextstartSpan(REQUEST request, CONNECTION connection, STORAGE storage, String spanName, long startTimestamp)Deprecated.protected abstract Stringtarget(REQUEST request)Deprecated.protected Stringurl(REQUEST request)Deprecated.-
Methods inherited from class io.opentelemetry.instrumentation.api.tracer.BaseTracer
end, end, endExceptionally, extract, getInstrumentationName, getVersion, inject, onException, shouldStartSpan, spanBuilder, startSpan, startSpan, startSpan, unwrapThrowable, withClientSpan, withConsumerSpan, withServerSpan
-
-
-
-
Field Detail
-
CONTEXT_ATTRIBUTE
public static final String CONTEXT_ATTRIBUTE
Deprecated.
-
USER_AGENT
protected static final String USER_AGENT
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
startSpan
public io.opentelemetry.context.Context startSpan(REQUEST request, CONNECTION connection, STORAGE storage, Method origin)
Deprecated.
-
startSpan
public io.opentelemetry.context.Context startSpan(REQUEST request, CONNECTION connection, STORAGE storage, String spanName)
Deprecated.
-
startSpan
public io.opentelemetry.context.Context startSpan(REQUEST request, CONNECTION connection, @Nullable STORAGE storage, String spanName, long startTimestamp)
Deprecated.
-
customizeContext
protected io.opentelemetry.context.Context customizeContext(io.opentelemetry.context.Context context, REQUEST request)Deprecated.Override in subclass to customize context that is returned bystartSpan.
-
end
public void end(io.opentelemetry.context.Context context, RESPONSE response)Deprecated.
-
end
public void end(io.opentelemetry.context.Context context, RESPONSE response, long timestamp)Deprecated.
-
endExceptionally
public void endExceptionally(io.opentelemetry.context.Context context, Throwable throwable)Deprecated.Convenience method. Delegates toendExceptionally(Context, Throwable, Object), passingresponsevalue ofnull.- Overrides:
endExceptionallyin classBaseTracer- See Also:
BaseTracer.onException(Context, Throwable),BaseTracer.end(Context)
-
endExceptionally
public void endExceptionally(io.opentelemetry.context.Context context, Throwable throwable, RESPONSE response)Deprecated.Convenience method. Delegates toendExceptionally(Context, Throwable, Object, long), passingtimestampvalue of-1.
-
endExceptionally
public void endExceptionally(io.opentelemetry.context.Context context, Throwable throwable, RESPONSE response, long timestamp)Deprecated.Ifresponseisnull, thehttp.status_codewill be set to500and theSpanstatus will be set toStatusCode.ERROR.
-
getServerSpan
public io.opentelemetry.api.trace.Span getServerSpan(STORAGE storage)
Deprecated.
-
getServerContext
@Nullable public abstract io.opentelemetry.context.Context getServerContext(STORAGE storage)
Deprecated.Returns context stored to the given request-response-loop storage byattachServerContext(Context, Object).
-
onConnection
protected void onConnection(io.opentelemetry.api.trace.SpanBuilder spanBuilder, CONNECTION connection)Deprecated.
-
onRequest
protected void onRequest(io.opentelemetry.api.trace.SpanBuilder spanBuilder, REQUEST request)Deprecated.
-
onConnectionAndRequest
protected void onConnectionAndRequest(io.opentelemetry.api.trace.SpanBuilder spanBuilder, CONNECTION connection, REQUEST request)Deprecated.
-
peerPort
@Nullable protected abstract Integer peerPort(CONNECTION connection)
Deprecated.
-
peerHostIp
@Nullable protected abstract String peerHostIp(CONNECTION connection)
Deprecated.
-
flavor
protected abstract String flavor(CONNECTION connection, REQUEST request)
Deprecated.
-
getGetter
protected abstract io.opentelemetry.context.propagation.TextMapGetter<REQUEST> getGetter()
Deprecated.
-
requestHeader
@Nullable protected abstract String requestHeader(REQUEST request, String name)
Deprecated.
-
responseStatus
protected abstract int responseStatus(RESPONSE response)
Deprecated.
-
attachServerContext
protected abstract void attachServerContext(io.opentelemetry.context.Context context, STORAGE storage)Deprecated.Stores given context in the given request-response-loop storage in implementation specific way.
-
isRelativeUrl
protected boolean isRelativeUrl(String url)
Deprecated.
-
-