-
Notifications
You must be signed in to change notification settings - Fork 575
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
@graphql-yoga/plugin-prometheus breaks subscriptions over graphql-ws #3374
Comments
@graphql-yoga/plugin-prometheus
breaks subscriptions over graphql-ws
@graphql-yoga/plugin-prometheus
breaks subscriptions over graphql-ws
The error is here:
When using subscriptions there is no // When parsing subscriptions, there is no request
if (!request) {
return;
}
paramsByRequest.set(request, {
document,
operationName: operationAST?.name?.value,
operationType: operationAST?.operation
}); fixes the issue. But I'm also not sure why we're using So perhaps the best fix is to use the |
Right now I'm using the custom minimal metrics plugin, because I only really need the |
Have there been any fixes or solutions to this issue since July? Because I have almost the same problem with Hive, which also uses this plugin. |
Describe the bug
On installing the prometheus plugin, subscriptions fail with the error:
If we comment out the plugin, subscriptions work again.
If we use the plugins from
@envelop/prometheus
, the subscriptions work again, but http://localhost:4000/metrics gives a 404.What is the correct way to use the plugin with graphql-ws subscriptions?
I can also open a PR but will need guidance on what the fix is.
Your Example Website or App
https://github.com/snigdha920/bun-graphql-yoga-prometheus/tree/main
Steps to Reproduce the Bug or Issue
bun dev
and this error in the console:
usePrometheus
plugin, run the subscription again, works as expectedExpected behavior
I expected the subscription to return data
Screenshots or Videos
No response
Platform
@graphql-yoga/*
version(s): 5.6.1Additional context
No response
The text was updated successfully, but these errors were encountered: