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

Add process spans to aws2 sqs instrumentation #9778

Merged
merged 9 commits into from
Nov 10, 2023

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Oct 30, 2023

This pr makes SQS instrumentation create similarly telemetry to kafka instrumentation, also support is added for the receive telemetry flag. Like in kafka instrumentation process span is created by placing messages in a custom list whose iterator creates span on next and closes it on hasNext.
Aws2 library instrumentation now requires an extra step, sqs client needs to be wrapped to support creating process spans.
Currently process spans has all the rpc/http client attributes besides the ones that use the response. This is a bit strange as the receive span also has them (also including the ones that use response). Should this be changed to remove these from process span when receive is enabled? Or should we always put all of these (including the ones that use response) on process span?

@@ -203,17 +207,18 @@ class S3TracingTest extends AgentInstrumentationSpecification {
"rpc.system" "aws-api"
"rpc.service" "AmazonSQS"
"http.method" "POST"
"http.status_code" 200
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should process spans have attributes that require response?

import java.util.Iterator;
import javax.annotation.Nullable;

class TracingIterator implements Iterator<Message> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TracingIterator and TracingList are slightly modified copies from kafka instrumentation


public final class AwsSdkSingletons {

private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class is also used in the javaagent instrumentation. Perhaps this should be copied there so it could use InstrumentationConfig?

@laurit laurit marked this pull request as ready for review October 31, 2023 13:51
@laurit laurit requested a review from a team as a code owner October 31, 2023 13:51
@laurit laurit changed the title Add process spans to aws sqs instrumentation Add process spans to aws2 sqs instrumentation Nov 8, 2023
@laurit laurit merged commit 4a9b965 into open-telemetry:main Nov 10, 2023
47 checks passed
@laurit laurit deleted the aws-sqs-spans branch November 10, 2023 12:20
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.

None yet

2 participants