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 studio trace id in selectors and document context entry #5189

Merged
merged 13 commits into from
May 24, 2024

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented May 16, 2024

Add support for a new trace id selector kind, the apollo trace id which represents the trace id on Apollo Studio.

Example:

telemetry:
  instrumentation:
    spans:
      router:
        "studio.trace.id":
            trace_id: apollo

Add documentation for available rhai constants.

Fixes #3803
Fixes #5172


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

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.

bnjjj added 2 commits May 16, 2024 10:06
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj requested a review from a team as a code owner May 16, 2024 14:04

This comment has been minimized.

@router-perf
Copy link

router-perf bot commented May 16, 2024

CI performance tests

  • step - Basic stress test that steps up the number of users over time
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • large-request - Stress test with a 1 MB request payload
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • xxlarge-request - Stress test with 100 MB request payload
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • xlarge-request - Stress test with 10 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • no-graphos - Basic stress test, no GraphOS.
  • reload - Reload test over a long period of time at a constant rate of users
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • const - Basic stress test that runs with a constant number of users

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj requested review from garypen and BrynCooke May 16, 2024 14:06
bnjjj and others added 2 commits May 16, 2024 16:25
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Gary Pennington <gary@apollographql.com>
@bnjjj bnjjj requested a review from garypen May 16, 2024 15:18
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

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

I'm requesting change for the selectors.mdx change because I don't think that will work properly without escaping the pipe.
Apart from that it looks great and thanks for documenting the Rhai constants.

Co-authored-by: Gary Pennington <gary@apollographql.com>
@bnjjj
Copy link
Contributor Author

bnjjj commented May 17, 2024

@garypen good catch ! Thanks

@bnjjj bnjjj requested a review from garypen May 17, 2024 08:28
Copy link
Contributor

@shorgi shorgi left a comment

Choose a reason for hiding this comment

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

Docs review

Co-authored-by: Edward Huang <edward.huang@apollographql.com>
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.

Can we introduce an integration test for this? I think it should jsut work as the apollo key and graph ref is present.

@bnjjj bnjjj closed this May 22, 2024
@bnjjj bnjjj reopened this May 22, 2024
bnjjj and others added 5 commits May 23, 2024 17:24
Co-authored-by: Edward Huang <edward.huang@apollographql.com>
Co-authored-by: Edward Huang <edward.huang@apollographql.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
…ographql/router into bnjjj/add_studio_trace_id_selector
@bnjjj
Copy link
Contributor Author

bnjjj commented May 23, 2024

@BrynCooke integration test added

@bnjjj bnjjj requested a review from BrynCooke May 23, 2024 15:45
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj enabled auto-merge (squash) May 24, 2024 09:16
@bnjjj bnjjj merged commit 939b903 into dev May 24, 2024
12 of 14 checks passed
@bnjjj bnjjj deleted the bnjjj/add_studio_trace_id_selector branch May 24, 2024 09:23
@Geal Geal mentioned this pull request May 29, 2024
lrlna pushed a commit that referenced this pull request Jun 3, 2024
…ry (#5189)

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Gary Pennington <gary@apollographql.com>
Co-authored-by: Edward Huang <edward.huang@apollographql.com>
Comment on lines +344 to +352
```
Router.APOLLO_SDL // Context key to access the SDL
Router.APOLLO_START // Constant to calculate durations
Router.APOLLO_AUTHENTICATION_JWT_CLAIMS // Context key to access authentication jwt claims
Router.APOLLO_SUBSCRIPTION_WS_CUSTOM_CONNECTION_PARAMS // Context key to modify or access the custom connection params when using subscriptions in WebSocket to subgraphs (cf subscription docs)
Router.APOLLO_ENTITY_CACHE_KEY // Context key to access the entity cache key
Router.APOLLO_OPERATION_ID // Context key to get the value of apollo operation id (studio trace id) from the context
```

Copy link
Member

Choose a reason for hiding this comment

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

@shorgi Not urgent, but this probably needs some other visual treatment.

@abernix
Copy link
Member

abernix commented Jun 3, 2024

I think this whole feature should have been called "operation ID"? We pluck the value from APOLLO_OPERATION_ID; it's not a trace ID, right?

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.

Add support for studio trace id selector in telemetry docs: add apollo_operation_id
5 participants