Skip to content

Content-type problem #7476

Dec 9, 2024 · 6 comments · 1 reply
Discussion options

You must be logged in to vote

The prom-exporter plugin is an external project by a different maintainer: https://github.com/kvaster/zwavejs-prom

The plugin code is responsible for setting up the /metrics endpoint request handler and sending the response including setting the content type. Here's the existing code from the plugin:

https://github.com/kvaster/zwavejs-prom/blob/ece34753358848b24ab478e3c689e28c942797c8/index.js#L79-L81

    async sendMetrics(req, res) {
        this.registry.metrics().then((m) => res.send(m))
    }

Compare to the example code from the upstream prom-client project, which shows that the request handler needs to set the content type:

https://github.com/siimon/prom-client/blob/c1d76c5d497ef803f…

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AlCalzone
Comment options

Answer selected by AlCalzone
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants