n1ru4l / envelop

Envelop is a lightweight library allowing developers to easily develop, share, collaborate and extend their GraphQL execution layer. Envelop is the missing GraphQL plugin system.
https://envelop.dev
MIT License
788 stars 128 forks source link

`[@envelop/plugin-prometheus]` histogram config is not possible to pass as an array of custom bucket sizes #2307

Open klippx opened 1 month ago

klippx commented 1 month ago

Issue workflow progress


Describe the bug

According to docs and typings it should be possible to use this plugin passing the config as an array of numbers:

* You can pass multiple type of values: * - number[]: Enable the metric with custom buckets * - ReturnType<typeof createHistogram>: Enable the metric with custom configuration

However, this doesn't work at all 😥

To Reproduce Steps to reproduce the behavior:

https://stackblitz.com/edit/node-m9bjmu?file=index.js

Expected behavior

That it works according to documentation, I should be able to pass an array of bucket sizes. I want to keep my bucket sizes consistent across all services in my stack.

Environment:

See stackblitz