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

Convert RabbitMQ to Instrumenter #4463

Merged
merged 3 commits into from
Oct 27, 2021
Merged

Convert RabbitMQ to Instrumenter #4463

merged 3 commits into from
Oct 27, 2021

Conversation

iNikem
Copy link
Contributor

@iNikem iNikem commented Oct 21, 2021

This is one strange instrumentation, which assigns attributes to span in arbitrary points of time from different methods...

@@ -199,14 +206,17 @@ public static void extractAndStartSpan(
return;
}

Context parentContext = Java8BytecodeBridge.currentContext();
ReceiveRequest request =
ReceiveRequest.create(queue, startTime, response, channel.getConnection());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the response part of the request? Couldn't it be passed to the end() Instrumenter call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

io.opentelemetry.javaagent.instrumentation.rabbitmq.RabbitReceiveAttributesExtractor#destination uses response to get required information

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's strange that we're using exchange name for messaging.destination and queue name for span name - but I suppose that should be fixed in another PR; maybe once messaging conventions are stable.


import java.time.Instant;

public final class Timer {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a few of these now, should we move to instrumentation-api (not in this PR)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logged issue to discuss #4514

@trask trask merged commit 458ff3e into open-telemetry:main Oct 27, 2021
@iNikem iNikem deleted the rabbit branch October 27, 2021 06:40
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Convert RabbitMQ to Instrumenter

* Polish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants