Configuration interface for prometheus exporter

interface ExporterConfig {
    appendTimestamp?: boolean;
    endpoint?: string;
    host?: string;
    metricProducers?: metrics.MetricProducer[];
    port?: number;
    prefix?: string;
    preventServerStart?: boolean;
    withResourceConstantLabels?: RegExp;
}

Properties

appendTimestamp?: boolean

Append timestamp to metrics

true
endpoint?: string

Endpoint the metrics should be exposed at with preceding slash

'/metrics'
host?: string
undefined (all interfaces)
metricProducers?: metrics.MetricProducer[]

Note, this option is experimental. Additional MetricProducers to use as a source of aggregated metric data in addition to the SDK's metric data. The resource returned by these MetricProducers is ignored; the SDK's resource will be used instead.

port?: number

Port number for Prometheus exporter server

Default registered port is 9464: https://github.com/prometheus/prometheus/wiki/Default-port-allocations

9464
prefix?: string

App prefix for metrics, if needed

''
preventServerStart?: boolean

Prevent the Prometheus exporter server from starting

false
withResourceConstantLabels?: RegExp

Regex pattern for defining which resource attributes will be applied as constant labels to the metrics. e.g. 'telemetry_.+' for all attributes starting with 'telemetry'.

undefined (no resource attributes are applied)