prom-client icon indicating copy to clipboard operation
prom-client copied to clipboard

Is it possible to use in Bun/Deno/other runtime?

Open krutoo opened this issue 2 years ago • 4 comments

Hi, currently i use prom-client in nodejs app and want to use it in other runtime such as Deno or Bun

Is it possible today?

krutoo avatar May 12 '23 10:05 krutoo

I dunno. We use a bunch of node specific APIs, but mostly in the default metrics. I guess you could omit them?

I've never used either Deno or Bun, so you'd have to tell us and potentially send PRs for changes needed 🙂

SimenB avatar May 12 '23 12:05 SimenB

Yes, node and v8 specific default metrics can be omitted

krutoo avatar May 13 '23 07:05 krutoo

@krutoo if you want to test my PR, that would be helpful: bun install siimon/prom-client#zb/bun.

zbjornson avatar Nov 25 '23 05:11 zbjornson

@zbjornson @SimenB i see that Bun now partially implements perf_hooks: https://bun.sh/docs/runtime/nodejs-apis#node-perf-hooks

But missing createHistogram and monitorEventLoopDelay.

When i try to use PromClient.collectDefaultMetrics In my Bun app i get error:

NotImplementedError: perf_hooks.monitorEventLoopDelay is not yet implemented in Bun.
 code: "ERR_NOT_IMPLEMENTED"

krutoo avatar Feb 28 '24 08:02 krutoo

Yes, node and v8 specific default metrics can be omitted

@krutoo How? Is it documented anywhere? I want to omit metric by metric

dawidsowardx avatar Apr 02 '24 17:04 dawidsowardx

Yes, node and v8 specific default metrics can be omitted

@krutoo How? Is it documented anywhere? I want to omit metric by metric

@dawidsowardx I mean in my case I skip call PromClient.collectDefaultMetrics() and collect only custom metrics

krutoo avatar Apr 02 '24 17:04 krutoo

https://github.com/siimon/prom-client/releases/tag/v15.1.2

SimenB avatar Apr 16 '24 06:04 SimenB