interface PrometheusMetricsInit {
    collectDefaultMetrics?: boolean;
    defaultMetrics?: DefaultMetricsCollectorConfiguration<RegistryContentType>;
    preserveExistingMetrics?: boolean;
    registry?: Registry<"text/plain; version=0.0.4; charset=utf-8">;
    statfsLocation?: string;
}

Properties

collectDefaultMetrics?: boolean

By default we collect default metrics - CPU, memory etc, to not do this, pass true here

prom-client options to pass to the collectDefaultMetrics function

preserveExistingMetrics?: boolean

All metrics in prometheus are global so to prevent clashes in naming we reset the global metrics registry on creation - to not do this, pass true here

registry?: Registry<"text/plain; version=0.0.4; charset=utf-8">

Use a custom registry to register metrics. By default, the global registry is used to register metrics.

statfsLocation?: string

The current filesystem usage is reported as the metric nodejs_fs_usage_bytes using the statfs function from node:fs - the default location to stat is the current working directory, configured this location here