Skip to content
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

Merged
merged 7 commits into from
Jul 18, 2022

Conversation

marcingrzejszczak
Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Jul 14, 2022

Prerequisite - https://github.com/micrometer-metrics/micrometer/pull/3293/files

  • remove any usaes of http handlers

@@ -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<>();
Copy link

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 ]

@@ -337,11 +337,9 @@ 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<>();
Copy link

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 ]

@@ -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<>();
Copy link

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 ]

@@ -457,11 +457,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<>();
Copy link

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 ]

@@ -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<>();
Copy link

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 ]

@@ -418,11 +418,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<>();
Copy link

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 ]

@marcingrzejszczak marcingrzejszczak merged commit 128e288 into main Jul 18, 2022
@marcingrzejszczak marcingrzejszczak deleted the receiverAndSenderContexts branch July 18, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants