-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sender and receiver propagating observation handlers #36
Changes from all commits
de1ec3a
189427f
781aae9
81871ee
0478643
01a5249
b171042
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,8 @@ | |
import io.micrometer.tracing.SamplerFunction; | ||
import io.micrometer.tracing.exporter.FinishedSpan; | ||
import io.micrometer.tracing.handler.DefaultTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpClientTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpServerTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingReceiverTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingSenderTracingObservationHandler; | ||
import io.micrometer.tracing.http.HttpClientHandler; | ||
import io.micrometer.tracing.http.HttpServerHandler; | ||
import io.micrometer.tracing.otel.bridge.ArrayListSpanProcessor; | ||
|
@@ -366,12 +366,10 @@ private static Consumer<OtelBuildingBlocks> closingFunction() { | |
@SuppressWarnings("rawtypes") | ||
private static ObservationHandler<Observation.Context> tracingHandlers(OtelBuildingBlocks otelBuildingBlocks) { | ||
OtelTracer tracer = otelBuildingBlocks.otelTracer; | ||
HttpServerHandler httpServerHandler = otelBuildingBlocks.httpServerHandler; | ||
HttpClientHandler httpClientHandler = otelBuildingBlocks.httpClientHandler; | ||
|
||
LinkedList<ObservationHandler<? extends Observation.Context>> handlers = new LinkedList<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JdkObsolete: It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not. Reply with "@sonatype-lift help" for info about LiftBot commands. When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands. Was this a good recommendation? |
||
handlers.add(new HttpServerTracingObservationHandler(tracer, httpServerHandler)); | ||
handlers.add(new HttpClientTracingObservationHandler(tracer, httpClientHandler)); | ||
handlers.add(new PropagatingSenderTracingObservationHandler<>(tracer, otelBuildingBlocks.propagator)); | ||
handlers.add(new PropagatingReceiverTracingObservationHandler<>(tracer, otelBuildingBlocks.propagator)); | ||
handlers.add(new DefaultTracingObservationHandler(tracer)); | ||
otelBuildingBlocks.customizers.accept(otelBuildingBlocks, handlers); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,8 @@ | |
import io.micrometer.tracing.brave.bridge.BraveTracer; | ||
import io.micrometer.tracing.exporter.FinishedSpan; | ||
import io.micrometer.tracing.handler.DefaultTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpClientTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpServerTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingReceiverTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingSenderTracingObservationHandler; | ||
import io.micrometer.tracing.http.HttpClientHandler; | ||
import io.micrometer.tracing.http.HttpServerHandler; | ||
import io.micrometer.tracing.reporter.wavefront.WavefrontBraveSpanHandler; | ||
|
@@ -419,11 +419,10 @@ private static Consumer<BraveBuildingBlocks> closingFunction() { | |
@SuppressWarnings("rawtypes") | ||
private static ObservationHandler<Observation.Context> tracingHandlers(BraveBuildingBlocks braveBuildingBlocks) { | ||
Tracer tracer = braveBuildingBlocks.tracer; | ||
HttpServerHandler httpServerHandler = braveBuildingBlocks.httpServerHandler; | ||
HttpClientHandler httpClientHandler = braveBuildingBlocks.httpClientHandler; | ||
|
||
LinkedList<ObservationHandler<? extends Observation.Context>> handlers = new LinkedList<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JdkObsolete: It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not. Reply with "@sonatype-lift help" for info about LiftBot commands. When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands. Was this a good recommendation? |
||
handlers.add(new HttpServerTracingObservationHandler(tracer, httpServerHandler)); | ||
handlers.add(new HttpClientTracingObservationHandler(tracer, httpClientHandler)); | ||
handlers.add(new PropagatingSenderTracingObservationHandler<>(tracer, braveBuildingBlocks.propagator)); | ||
handlers.add(new PropagatingReceiverTracingObservationHandler<>(tracer, braveBuildingBlocks.propagator)); | ||
handlers.add(new DefaultTracingObservationHandler(tracer)); | ||
braveBuildingBlocks.customizers.accept(braveBuildingBlocks, handlers); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,8 @@ | |
import io.micrometer.tracing.SamplerFunction; | ||
import io.micrometer.tracing.exporter.FinishedSpan; | ||
import io.micrometer.tracing.handler.DefaultTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpClientTracingObservationHandler; | ||
import io.micrometer.tracing.handler.HttpServerTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingReceiverTracingObservationHandler; | ||
import io.micrometer.tracing.handler.PropagatingSenderTracingObservationHandler; | ||
import io.micrometer.tracing.http.HttpClientHandler; | ||
import io.micrometer.tracing.http.HttpServerHandler; | ||
import io.micrometer.tracing.otel.bridge.ArrayListSpanProcessor; | ||
|
@@ -158,7 +158,7 @@ public static class OtelBuildingBlocks implements BuildingBlocks { | |
|
||
private final OtelTracer otelTracer; | ||
|
||
private final OtelPropagator otelPropagator; | ||
private final OtelPropagator propagator; | ||
|
||
private final HttpServerHandler httpServerHandler; | ||
|
||
|
@@ -173,16 +173,16 @@ public static class OtelBuildingBlocks implements BuildingBlocks { | |
* | ||
* @param wavefrontOTelSpanHandler span handler | ||
* @param otelTracer otel tracer | ||
* @param otelPropagator otel propagator | ||
* @param propagator otel propagator | ||
* @param httpServerHandler otel http server handler | ||
* @param httpClientHandler otel http client handler | ||
* @param customizers observation customizers | ||
* @param arrayListSpanProcessor array list span processor | ||
*/ | ||
public OtelBuildingBlocks(WavefrontOtelSpanHandler wavefrontOTelSpanHandler, OtelTracer otelTracer, OtelPropagator otelPropagator, HttpServerHandler httpServerHandler, HttpClientHandler httpClientHandler, BiConsumer<BuildingBlocks, Deque<ObservationHandler<? extends Observation.Context>>> customizers, ArrayListSpanProcessor arrayListSpanProcessor) { | ||
public OtelBuildingBlocks(WavefrontOtelSpanHandler wavefrontOTelSpanHandler, OtelTracer otelTracer, OtelPropagator propagator, HttpServerHandler httpServerHandler, HttpClientHandler httpClientHandler, BiConsumer<BuildingBlocks, Deque<ObservationHandler<? extends Observation.Context>>> customizers, ArrayListSpanProcessor arrayListSpanProcessor) { | ||
this.wavefrontOTelSpanHandler = wavefrontOTelSpanHandler; | ||
this.otelTracer = otelTracer; | ||
this.otelPropagator = otelPropagator; | ||
this.propagator = propagator; | ||
this.httpServerHandler = httpServerHandler; | ||
this.httpClientHandler = httpClientHandler; | ||
this.customizers = customizers; | ||
|
@@ -196,7 +196,7 @@ public io.micrometer.tracing.Tracer getTracer() { | |
|
||
@Override | ||
public Propagator getPropagator() { | ||
return this.otelPropagator; | ||
return this.propagator; | ||
} | ||
|
||
@Override | ||
|
@@ -450,11 +450,10 @@ private static Consumer<OtelBuildingBlocks> closingFunction() { | |
@SuppressWarnings("rawtypes") | ||
private static ObservationHandler<Observation.Context> tracingHandlers(OtelBuildingBlocks otelBuildingBlocks) { | ||
OtelTracer tracer = otelBuildingBlocks.otelTracer; | ||
HttpServerHandler httpServerHandler = otelBuildingBlocks.httpServerHandler; | ||
HttpClientHandler httpClientHandler = otelBuildingBlocks.httpClientHandler; | ||
|
||
LinkedList<ObservationHandler<? extends Observation.Context>> handlers = new LinkedList<>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JdkObsolete: It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not. Reply with "@sonatype-lift help" for info about LiftBot commands. When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands. Was this a good recommendation? |
||
handlers.add(new HttpServerTracingObservationHandler(tracer, httpServerHandler)); | ||
handlers.add(new HttpClientTracingObservationHandler(tracer, httpClientHandler)); | ||
handlers.add(new PropagatingSenderTracingObservationHandler<>(tracer, otelBuildingBlocks.propagator)); | ||
handlers.add(new PropagatingReceiverTracingObservationHandler<>(tracer, otelBuildingBlocks.propagator)); | ||
handlers.add(new DefaultTracingObservationHandler(tracer)); | ||
otelBuildingBlocks.customizers.accept(otelBuildingBlocks, handlers); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JdkObsolete: It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.
When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]