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

[question] how to ignore specific error? #12

Closed
FedeBev opened this issue Aug 4, 2021 · 2 comments
Closed

[question] how to ignore specific error? #12

FedeBev opened this issue Aug 4, 2021 · 2 comments

Comments

@FedeBev
Copy link

FedeBev commented Aug 4, 2021

Hi there,
thanks for this work.

Is there a way to filter out some error from the query_failed metric? Let's say wrong auth credentials, login expired for example and so on....

Thanks

@bfmatei
Copy link
Owner

bfmatei commented Sep 7, 2021

I am working on a new version that will allow customizing when specific metrics are gathered. I hope I will manage to finish it by the end of this week.

@bfmatei
Copy link
Owner

bfmatei commented Oct 11, 2021

Support added in both 2.1.0 (for Apollo Server 3) and 1.3.0 (for Apollo Server 2).

Example:

createPrometheusPlugin({
  // ...
  skipMetrics: {
    [MetricsNames.QUERY_FAILED]: (_labels, context) => // do whatever you need here and return true/false
  }
});

@bfmatei bfmatei closed this as completed Oct 11, 2021
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