Skip to main content

Insights.MetricsSettingsinterface

Settings for publishing io.Insights metrics.

Properties (20)

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%).

A function is asked once, on the first read after the build, and its answer is kept: the SDK's resource is made once, at its creation, and the readers that look at the resource attributes on every span (the span filters' context, the sampler) see the same values.

addResourceAttributesToAttributes⚓︎ boolean false x

Whether to add resource attributes to metric data point attributes.

concurrencyLimit⚓︎ number x x

Maximum number of concurrent metric export requests.

defaultPublishingSettings⚓︎ MetricPublishingSettings x x

Default publishing settings for metrics.

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 objects, each describing a metric filter. Use this property to specify which metrics to be collected and exported by the Browser Client app.

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

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

maxAttributeDepth⚓︎ number 5 x

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

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 objects, each describing a metric. Use this property to specify settings for your custom metrics.

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.