Open
Description
Is your feature request related to a problem? Please describe.
We are using hive-gateway
and the prometheus plugin. We want to conditionally use graphql_yoga_http_duration
for certain operations only, but it can only always be used or never be used.
Describe the solution you'd like
metrics: {
graphql_yoga_http_duration: createHistogram({
registry,
histogram: {
name: 'graphql_yoga_http_duration',
help: 'Time spent on HTTP connection',
labelNames: ['operation_name'],
buckets: HISTOGRAM_BUCKET_DIMENSIONS,
},
fillLabelsFn: ({ operationName }, _rawContext) => ({
operation_name: operationName,
}),
// A hook to decide when recording should be made
shouldRecordFn: ({ operationName }, _rawContext) =>
TRACKED_OPERATIONS.includes(operationName),
}),
},
Describe alternatives you've considered
Build our own middleware stack mostly duplicating everything
Metadata
Metadata
Assignees
Labels
No labels