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

Error: Added label "field_name" is not included in initial labelset #867

Closed
earnubs opened this issue Feb 15, 2022 · 2 comments
Closed

Error: Added label "field_name" is not included in initial labelset #867

earnubs opened this issue Feb 15, 2022 · 2 comments

Comments

@earnubs
Copy link
Contributor

earnubs commented Feb 15, 2022

Describe the bug

Errors thrown in GraphQL execute phase are not handled:

node_1               | Error: Added label "field_name" is not included in initial labelset: [ 'operation_name', 'operation_name', 'phase' ]
node_1               |     at validateLabel (/opt/node_app/node_modules/prom-client/lib/validation.js:20:10)
node_1               |     at Counter.inc (/opt/node_app/node_modules/prom-client/lib/counter.js:24:4)
node_1               |     at /opt/node_app/node_modules/@promster/apollo/dist/promster-apollo.cjs.dev.js:164:28
node_1               |     at Array.forEach (<anonymous>)
node_1               |     at /opt/node_app/node_modules/@promster/apollo/dist/promster-apollo.cjs.dev.js:163:160
node_1               |     at /opt/node_app/node_modules/apollo-server-core/dist/utils/dispatcher.js:57:17
node_1               |     at /opt/node_app/node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js:76:56
node_1               |     at processTicksAndRejections (node:internal/process/task_queues:96:5)

To Reproduce
Steps to reproduce the behavior:

And directive which throws an error in execute phase won't be handled / counted.

Expected behavior

Expect graphql_errors_total to increment

Additional context

Attempted to write a test for the issue here, not sure if the solution is correct https://github.com/tdeekens/promster/compare/main...earnubs:errors-in-execution-phase?expand=1

@tdeekens
Copy link
Owner

Thanks a lot for reporting and the proposed fix. Upon first glimpse it looks good. I will set aside some time to review. Do you want to open a PR?

@earnubs
Copy link
Contributor Author

earnubs commented Feb 15, 2022

#868

Not 100% sure about the snapshot in my PR, specifically the error count value, but I think the test itself is doing the right thing.

Let me know if there's anything I can do to fix/tidy the PR.

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

No branches or pull requests

2 participants