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

Instrument coprocessor request with http_request span #6776

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

theJC
Copy link
Contributor

@theJC theJC commented Feb 12, 2025

Instrument coprocessor request with http_request span, to be consistent in observability to subgraph http requests.

Code basically copy/pasted from apollo-router/src/services/http/service.rs

Provides Apollo's customers insight into latency that may be introduced over the network stack when communicating with coprocessor.

Fixes #6739


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Manual test:
Screenshot 2025-02-12 at 2 38 37 AM

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@theJC theJC requested review from a team as code owners February 12, 2025 08:40
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Feb 12, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 28bbf21931d152e6d0d74026

@theJC theJC requested a review from a team as a code owner February 12, 2025 08:53
@theJC theJC force-pushed the coprocessorHttprequestSpan branch from 0f05e85 to 2f80196 Compare February 12, 2025 08:58
@theJC
Copy link
Contributor Author

theJC commented Feb 13, 2025

@bnjjj -- Any chance I can ask for a couple minutes of your time for a review (or point someone to me or me to someone that would be the best person to take a look at this contribution)

Thank you in advance!

Copy link
Contributor

@BrynCooke BrynCooke left a comment

Choose a reason for hiding this comment

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

If we use the semantic conventions for the span attributes then I think we can merge this.

Ideally we would use the existing HttpClient code for coprocessors but this is a bigger change that would be backwards compatible with what we have here.

});
let path = schema_uri.path();

let http_req_span = tracing::info_span!(HTTP_REQUEST_SPAN_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the Otel semantic conventions here: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client

Copy link
Contributor Author

@theJC theJC Feb 18, 2025

Choose a reason for hiding this comment

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

Updated to include required attributes for http-client spans

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Zipkin view with semconv in place:
image

@theJC theJC requested a review from BrynCooke February 18, 2025 20:24
@theJC theJC force-pushed the coprocessorHttprequestSpan branch from 6a21406 to 3f8a305 Compare February 19, 2025 07:48
@BrynCooke
Copy link
Contributor

@theJC I will bring this PR into the router repo so that we can have the CI tests run. Any further changes can be made from there.

@theJC
Copy link
Contributor Author

theJC commented Feb 20, 2025

@BrynCooke -- Bringing the branch/MR into the Router repo is not something I can do for you, is it?

@BrynCooke
Copy link
Contributor

I'm ooo for the next couple of days. But I'll create the new pr when I am next at my computer.

@BrynCooke BrynCooke mentioned this pull request Feb 25, 2025
6 tasks
@BrynCooke
Copy link
Contributor

#6856

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