Configuration options for metrics collection. Extends the base metrics configuration with optional parameters.

MetricsOptions

interface MetricsOptions {
    attributes?: Attributes;
    debug?: boolean;
    hostname?: string;
    isEnabled?: boolean;
    sendInterval?: number;
    serviceName?: string;
    serviceVersion?: string;
    url?: string;
}

Hierarchy

  • Partial<MetricsConfig>
    • MetricsOptions

Properties

attributes?: Attributes

Optional attributes to be associated with the metrics.

debug?: boolean

Specifies whether to enable debug mode for metrics. Debug mode will enable the opentelemetry debug log and log metrics to the console.

hostname?: string

The value of the hostname attribute to use, will override the hostname.

isEnabled?: boolean

Specifies whether metrics is enabled.

sendInterval?: number

The interval in milliseconds to send the metrics.

serviceName?: string

The name of the service to put as attribute. By default will be read from the package.json file.

serviceVersion?: string

The version of the service to put as attribute. By default will be read from the package.json file.

url?: string

The URL to an HTTP OTLP endpoint to send the metrics to.