-
Notifications
You must be signed in to change notification settings - Fork 574
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
fix(prom): graphql-ws integration #3651
Conversation
🦋 Changeset detectedLatest commit: d9a0bfe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Apollo Federation Subgraph Compatibility Results
Learn more: |
💻 Website PreviewThe latest changes are available as preview in: https://4d1d0191.graphql-yoga.pages.dev |
✅ Benchmark Results
|
}; | ||
onParse({ context }) { | ||
// If only it is Yoga, we calculate HTTP request time | ||
if (context.request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand why we don't want to also track subscriptions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subscriptions are not the case here. Yoga subscriptions(SSE) are still tracked.
The issue is when GraphQL WS uses the Envelop instance of Yoga, this plugin fails because GraphQL WS doesn't have request
object in the context.
It is ok to skip this because GraphQL WS is not HTTP at all.
This doesn't skip tracking entirely, it just skips the metric starts on onRequest
and ends in onResponse
hooks. Those hooks are not triggered by GraphQL WS at all.
Fixes #3374
Fixes graphql-hive/gateway#450
Skip collecting Yoga/HTTP specific metrics in case of WS or any other usage of the Envelop instance of Yoga