You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for creating this useful library. I wanted to use it with my application which uses clustering and GraphQL metrics. I tried the script present at Scraping with multiple PM2 processes, and mysteriously it did not work and my entire process freezer - I ended up using Aggregation using default prom registry and express-prom-bundle middleware because it supports passing in register to be used. The code snippet for the same is below,
import { AggregatorRegistry, register } from 'prom-client';
const app = express();
const aggregatorRegistry = new AggregatorRegistry();
// register for prometheus
app.get('/metrics', async (_, res) => {
const metrics = await getAggregateMetrics();
res.set('Content-Type', aggregatorRegistry.contentType);
res.send(metrics.metrics());
});
// metrics for graphql requests
const apolloMetricsPlugin = createMetricsPlugin(register);
// metrics for rest requests
app.use(
promBundle({
autoregister: false, // disable /metrics for single workers
includeMethod: true,
includeStatusCode: true,
includePath: true,
promRegistry: register,
}),
);
I was wondering if a similar approach can be used to allow passing register into the swagger-stats client and use the same register when collecting metrics? This would make the metrics API much more flexible, especially for developers who want to see all metrics collected by various exporters at the same register and, consequently, at the same metrics endpoint. I'm looking for a configuration as follows:
Thanks a lot for creating this useful library. I wanted to use it with my application which uses clustering and GraphQL metrics. I tried the script present at Scraping with multiple PM2 processes, and mysteriously it did not work and my entire process freezer - I ended up using Aggregation using default prom registry and express-prom-bundle middleware because it supports passing in register to be used. The code snippet for the same is below,
I was wondering if a similar approach can be used to allow passing register into the swagger-stats client and use the same register when collecting metrics? This would make the metrics API much more flexible, especially for developers who want to see all metrics collected by various exporters at the same register and, consequently, at the same metrics endpoint. I'm looking for a configuration as follows:
PS. If we find that we want to implement this feature, I would be glad to raise PR for the same.
The text was updated successfully, but these errors were encountered: