siimon / prom-client

Prometheus client for node.js
Apache License 2.0
3.09k stars 372 forks source link

How to change registry type to OpenMetrics? #614

Closed zigazajc007 closed 5 months ago

zigazajc007 commented 7 months ago
image image image
jamesla commented 5 months ago

@zigazajc007 Did you solve this?

zigazajc007 commented 5 months ago

@zigazajc007 Did you solve this?

I didn't.

SimenB commented 5 months ago

The static prop is just missing from the types, it works at runtime. You can also do Prometheus.openMetricsContentType which is present in types

SimenB commented 5 months ago

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

jamesla commented 5 months ago

Thanks @SimenB but this is actualy still not working with the latest version

error TS2345: Argument of type '"application/openmetrics-text; version=1.0.0; charset=utf-8"' is not assignable to parameter of type '"text/plain; version=0.0.4; charset=utf-8"'.
SimenB commented 5 months ago

Hah. Still only a type error, so a @ts-ignore should do it.

Happy to take a PR fixing it properly