apollo-prometheus-exporter
apollo-prometheus-exporter copied to clipboard
Add prefix option for metrics
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
For anyone else looking, you can just use the underlying prom-client
defaultMetricsOptions
to achieve this:
const apolloExporterPlugin = createPrometheusExporterPlugin({
app,
defaultMetricsOptions: {
prefix: "apollo_",
},
});