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

Trying use skipMetrics, but it doesn't work #26

Open
monicajss opened this issue Nov 12, 2021 · 1 comment
Open

Trying use skipMetrics, but it doesn't work #26

monicajss opened this issue Nov 12, 2021 · 1 comment

Comments

@monicajss
Copy link

Hi, I'm trying to use skipMetrics to skip the label success=false from apollo_query_duration metrics. I tried as bellow:

import { createPrometheusExporterPlugin, MetricsNames} from '@bmatei/apollo-prometheus-exporter'
[...] 

const prometheusExporterPlugin = createPrometheusExporterPlugin({
      durationHistogramsBuckets: [0.5, 2],
      app,
     skipMetrics: { 
        [MetricsNames.QUERY_DURATION]: (labels) => {labels.success === 'false'}
         },
    })

Should I import something else? What am I doing wrong?

@pbromley
Copy link

I know this is really old but do you need to do either

 [MetricsNames.QUERY_DURATION]: (labels) => { return labels.success === 'false'; }

or

 [MetricsNames.QUERY_DURATION]: (labels) => labels.success === 'false'

I'm just looking at this type of thing myself at the moment

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