Skip to main content

Properties (28)

Property Type Default Required Description
additionalAttributes⚓︎ { [x: string]: unknown } | (() => { [x: string]: unknown }) x x

Additional metrics properties to publish as part of each metric, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?literalDefaultValue%).

additionalResourceAttributes⚓︎ { [x: string]: unknown } | (() => { [x: string]: unknown }) x x

Additional attributes to publish as part of the OTEL resource definition, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?literalDefaultValue%).

addResourceAttributesToAttributes⚓︎ boolean false x

Whether to add resource attributes to metric data point attributes.

compression⚓︎ CompressionAlgorithm x x

Compression algorithm to use when exporting metrics.

concurrencyLimit⚓︎ number x x

Maximum number of concurrent metric export requests.

defaultFilters⚓︎ MetricFilter[] x x

This property is for internal use only.

defaultPublishingSettings⚓︎ MetricPublishingSettings x x

Default publishing settings for metrics.

dependencyContainerOverride⚓︎ MetricsDependencyContainer x x

Optional override for the dependency container providing platform-specific metric handlers.

enabled⚓︎ boolean false

Whether metrics functionality is enabled. If disabled, API is still usable, but methods are no-ops.

exporterSettings⚓︎ (OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) x x

Options to use when creating the OTLPMetricExporter to use when exporting metrics.

filters⚓︎ MetricFilter[] x x

Array of filter rules to determine which metrics should be collected and exported.

headers⚓︎ { [x: string]: string } | (() => { [x: string]: string }) x x

Additional headers to send in HTTP requests, e.g. when using HTTP exporters.

hostname⚓︎ string x x

Hostname to include in exported metrics.

keepAlive⚓︎ boolean x x

Whether to use HTTP keep-alive connections for metric exports.

maxAttributeDepth⚓︎ number 5 x

How deep the library should recurse into objects when adding labels to metrics.

meter⚓︎ Partial<MetricsSettings> x x

Partial MetricsSettings for meter configuration.

meterProvider⚓︎ (meterProviderSettings: MeterProviderOptions, metricsSettings: MetricsSettings, settings: Settings) => MeterProvider x x x
meterProviderSettings⚓︎ MeterProviderOptions x x x
metricExporters⚓︎ (exporterSettings: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions, tracesSettings: MetricsSettings, settings: Settings) => PushMetricExporter[] x x

Custom metric exporter implementations for pushing metrics.

metricReaders⚓︎ (readerSettings: Partial<PeriodicExportingMetricReaderOptions>, exporterSettings: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions, tracesSettings: MetricsSettings, settings: Settings) => MetricReader[] x x

Custom metric reader implementations for pushing metrics.

metrics⚓︎ MetricSettings[] x x

Array of custom metric configurations. It allows specifying overrides for both platform and custom metrics.

platformMetricsEnabled⚓︎ boolean | "only-explicit" x x

Whether to enable automatic collection of platform-level metrics (CPU, memory, etc.). If true, the library will initialize all predefined platform metrics automatically. If only-explicit, it will not initialize them automatically, but will still allow you to configure your own platform metrics based on the predefined types using the metrics config property. If false, any platform metrics will be automatically disabled.

publishInterval⚓︎ number 30_000 x

Interval in milliseconds between metric export batches.

readerSettings⚓︎ PeriodicExportingMetricReaderOptions x x

Options to use when creating the PeriodicExportingMetricReader to use when exporting metrics.

timeoutMillis⚓︎ number 10000ms. x

Maximum time the OTLP exporter will wait for each batch export.

url⚓︎ string x x

The destination URL for exporting metrics via OTLP.

useDefaultFilters⚓︎ boolean true x

Whether to apply predefined default filters for platform metrics.

useLegacyWorkspaceStartupMetric⚓︎ boolean false x

If true, workspace_startup will be published as the legacy histogram metric from the io.Insights beta releases.