Skip to content

Conversation

PierrickP
Copy link

Similar to what offer prom-client for default metrics, add an option on the apollo export to add a prefix on apollo metrics

Example:

  const prometheusExporterPlugin = createPrometheusExporterPlugin({
    app,
    prefix: 'MY_PREFIX_'
  });

Will generate

MY_PREFIX_apollo_server_starting{version="v3.4.0",hostname="pierrickp-precision3551"} 1660204290.275

@barneyjackson
Copy link

For anyone else looking, you can just use the underlying prom-client defaultMetricsOptions to achieve this:

const apolloExporterPlugin = createPrometheusExporterPlugin({
    app,
    defaultMetricsOptions: {
        prefix: "apollo_",
    },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants