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 AwsAttributePropagatingSpanProcessor component to AWS X-Ray #777

Closed
wants to merge 2 commits into from

Conversation

bjrara
Copy link
Contributor

@bjrara bjrara commented Mar 10, 2023

Context

AwsAttributePropagatingSpanProcessor is designed to handle attributes aws.remote.application, aws.remote.operation and aws.local.operation which will later be used to generate metrics under the background of #789.

It has a prerequisite PR #800.

Description

AwsAttributePropagatingSpanProcessor accomplishes two things:

1. Propagating remote attributes.

The aws.remote.application and aws.remote.operation attributes are designed to be set by users into local client spans through manual instrumentation. However, since client spans are mostly generated by auto-instrumentation libraries which make them unaccessible to application developers.

OTEP-207 seems to be a general solution that could help address this requirement, but it hasn't been finalized yet. We took the idea from this comment which suggests to let SpanProcessor to do the propagation work.

AwsAttributePropagatingSpanProcessor is used as an alternative solution that inherit aws.remote.application and aws.remote.operation attributes from parent span to the child spans if present.

2. Setting and propagating local attributes.

SpanMetricsProcessor from #789 requires aws.local.operation (the initial entry point of a execution) to be injected into the local client spans to generate metrics that can later be used for other correlations.

AwsAttributePropagatingSpanProcessor sets this attribute with the span name of the local root span if the request is from remote, and passes it to child spans.

Testing

JUnit test is created for this new component in the package.

Documentation

It's an independent component that would require manual installation in the TracerProvider. We'll create a doc to describe the usage.

Outstanding items

NONE.

@bjrara bjrara requested a review from a team March 10, 2023 02:25
@bjrara bjrara force-pushed the remote_attributes branch 3 times, most recently from 01455a7 to 410b08b Compare March 13, 2023 16:52
Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

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

This change LGTM and I support it being included in the X-Ray contrib repo.

@open-telemetry/java-instrumentation-approvers PTAL and merge when ready :)

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

This looks ok to me. Note to other reviews that this artifact is stable so please take a close look at the new API surface area.

Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

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

Additional changes LGTM! This can be merged whenever and thanks for the review @jack-berg

@jack-berg
Copy link
Member

@open-telemetry/java-contrib-maintainers PTAL.

@bjrara bjrara marked this pull request as draft March 17, 2023 22:09
@bjrara
Copy link
Contributor Author

bjrara commented Mar 17, 2023

Put this PR on hold as the component might need to extend its scope to cooperate with #789.

@bjrara bjrara force-pushed the remote_attributes branch 3 times, most recently from c55671a to 666462e Compare March 29, 2023 20:42
@bjrara bjrara changed the title Add RemoteAttributesSpanProcessor component to AWS X-Ray Add AwsAttributePropagatingSpanProcessor component to AWS X-Ray Mar 29, 2023
@thpierce
Copy link
Contributor

Because the author of this PR is not currently available, I have created a new PR here: #856

Please close this PR if you are able.

@trask trask closed this Apr 28, 2023
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.

5 participants