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

[plugins/prometheus] missing operation name in graphql_yoga_http_duration_count metric on status 400 #3274

Closed
EmrysMyrddin opened this issue May 17, 2024 · 0 comments · Fixed by #3278
Assignees
Labels
kind/bug stage/0-issue-prerequisites Needs more information before we can start working on it

Comments

@EmrysMyrddin
Copy link
Collaborator

Describe the bug

When an error occurs at parsing or validation time (which yields a 400 status code response), the operation name is Anonymous even if an operation name have been provided.

query AllSizeGuides {
  cms {
    all_storefront_page(limit: 10) {
      items {
        category_id
      }
    }
  }
}

Will generate this metric:

graphql_yoga_http_duration_count{method="POST",statusCode="200",operationType="query",operationName="AllSizeGuides"} 1
query AllSizeGuides {
  cms {
    all_storefront_page(limit: 10) {
      items {
        category_id__NON_EXISTING
      }
    }
  }
}

Will generate this metric:

graphql_yoga_http_duration_count{method="POST",statusCode="400",operationName="Anonymous"} 1

Your Example Website or App

NA

Steps to Reproduce the Bug or Issue

NA

Expected behavior

The graphql_yoga_http_duration_count should always extract the operation name from the query document if available.

Screenshots or Videos

No response

Platform

NA

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug stage/0-issue-prerequisites Needs more information before we can start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant