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 support for X-Ray remote sampling #719

Conversation

gillesbergerp
Copy link

This implements #714

Copy link
Collaborator

@arielvalentin arielvalentin left a comment

Choose a reason for hiding this comment

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

This may sound naive but, why is this not using the AWS XRay SDK to interact with the API?

@gillesbergerp
Copy link
Author

Not at all and I am happy to adapt it but I was following the Java counterpart in this regard (https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/aws-xray). This also makes it easy to leave authentication tothe awsproxy extension for the collector as opposed to the application.

@arielvalentin
Copy link
Collaborator

Oh I see. So this does not make requests to the AWS API but rather to a collector to get remote sampling rates?

@gillesbergerp
Copy link
Author

gillesbergerp commented Nov 13, 2023

The awsproxy is an extension for the OpenTelemetry collector "accepts requests without any authentication of AWS signatures applied and forwards them to the AWS API, applying authentication and signing" and is developed by AWS in-house.
So the sampling rates/targets are still obtained from the X-Ray API - there just sits a proxy in-between.

@arielvalentin
Copy link
Collaborator

The awsproxy is an extension for the OpenTelemetry collector "accepts requests without any authentication of AWS signatures applied and forwards them to the AWS API, applying authentication and signing" and is developed by AWS in-house. So the sampling rates/targets are still obtained from the X-Ray API - there just sits a proxy in-between.

Understood. So this implementation would only work if the Collector were a proxy since it would be handling signing requests.

E.g.

sequenceDiagram
    OTel SDK X-Ray Remote Sampler ->>otel-col-aws-proxy: "/SamplingTargets" 
    otel-col-aws-proxy->>otel-col-aws-proxy: Generate Signed Request
    otel-col-aws-proxy->>AWS XRay API: "/SamplingTargets"
    AWS XRay API-->>otel-col-aws-proxy: SamplingTargetsResponse
    otel-col-aws-proxy-->> OTel SDK X-Ray Remote Sampler: SamplingTargetsResponse
Loading

Is that right?

@gillesbergerp
Copy link
Author

Yes, that's right. Unfortunately, the official X-Ray client does not accept unsigned requests (Aws::Errors::MissingCredentialsError: unable to sign request without credentials set)

@arielvalentin
Copy link
Collaborator

Thank you for taking the time to patiently explain this to me.

With that in mind, I'll take a look at this PR later this week.

@gillesbergerp
Copy link
Author

Thank you very much. Please let me know if I can be of assistance

@gillesbergerp gillesbergerp force-pushed the feature/gillesbergerp/sampling/xray branch from 579e8f6 to a706842 Compare November 20, 2023 04:10
Copy link
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Dec 21, 2023
@github-actions github-actions bot closed this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Marks an issue/PR stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants