Skip to content

Prometheus Endpoint is not available #1543

Answered by dotansimha
chengyak asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @chengyak !

With the pure Envelop plugin usePrometheus, we do not provide the service or the runtime for the Prom server.
Since this plugin only hooks to your prom-client instance, you should use the same instance, and just return it over JSON response, something like:

server.on("GET", "/metrics", async (req, res) => {
  res.header('Content-Type', promClient.register.contentType);
  const result = await promClient.register.metrics();
  res.send(result)
}

In GraphQL-Mesh, we have a configuration to set this up automatically for you, so you don't need to use the raw Envelop plugin, and you should use the Mesh plugin for Prom (see https://www.the-guild.dev/graphql/mesh/docs/plugins/prome…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@chengyak
Comment options

@dotansimha
Comment options

@chengyak
Comment options

@dotansimha
Comment options

Answer selected by chengyak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants