# Insights.MetricsSettings

**Kind**: interface | **Module**: [io.Connect Browser](https://docs.interop.io/browser/reference/javascript/io.connect%20browser/index.md)

**Source**: https://docs.interop.io/browser/reference/javascript/io.connect browser/insights.metricssettings/index.html

Settings for publishing io.Insights metrics.

## Properties

- **`additionalAttributes`** (`{ [x: string]: unknown; } | (() => { [x: string]: unknown; })`, optional)
  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; })`, optional)
  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`, optional) default: `false`
  Whether to add resource attributes to metric data point attributes.
- **`concurrencyLimit`** (`number`, optional)
  Maximum number of concurrent metric export requests.
- **`defaultPublishingSettings`** (`IOInsights.IOInsights.MetricPublishingSettings`, optional)
  Default publishing settings for metrics.
- **`enabled`** (`boolean`, required) default: `false`
  Whether metrics functionality is enabled.
  If disabled, API is still usable, but methods are no-ops.
- **`exporterSettings`** (`import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/otlp-exporter-base/build/src/index").OTLPExporterNodeConfigBase & import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterOptions").OTLPMetricExporterOptions`, optional)
  Options to use when creating the OTLPMetricExporter to use when exporting metrics.
- **`filters`** (`MetricFilter[]`, optional)
  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; }>)`, optional)
  Additional headers to send in HTTP requests, e.g. when using HTTP exporters.
- **`maxAttributeDepth`** (`number`, optional) default: `5`
  How deep the library should recurse into objects when adding
  labels to metrics.
- **`meterProvider`** (`(meterProviderSettings: import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider").MeterProviderOptions, metricsSettings: IOInsights.IOInsights.MetricsSettings, settings: IOInsights.IOInsights.Settings) => import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/api/build/src/index").MeterProvider`, optional)
- **`meterProviderSettings`** (`import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider").MeterProviderOptions`, optional)
- **`metricExporters`** (`(exporterSettings: import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/otlp-exporter-base/build/src/index").OTLPExporterNodeConfigBase & import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterOptions").OTLPMetricExporterOptions, tracesSettings: IOInsights.IOInsights.MetricsSettings, settings: IOInsights.IOInsights.Settings) => import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/index").PushMetricExporter[]`, optional)
  Custom metric exporter implementations for pushing metrics.
- **`metricReaders`** (`(readerSettings: Partial<import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/index").PeriodicExportingMetricReaderOptions>, exporterSettings: import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/otlp-exporter-base/build/src/index").OTLPExporterNodeConfigBase & import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@interopio/otel/node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterOptions").OTLPMetricExporterOptions, tracesSettings: IOInsights.IOInsights.MetricsSettings, settings: IOInsights.IOInsights.Settings) => import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/index").MetricReader[]`, optional)
  Custom metric reader implementations for pushing metrics.
- **`metrics`** (`MetricSettings[]`, optional)
  Array of objects, each describing a metric.
  Use this property to specify settings for your custom metrics.
- **`publishInterval`** (`number`, optional) default: `30_000`
  Interval in milliseconds between metric export batches.
- **`readerSettings`** (`import("/home/runner/_work/connect-js/connect-js/docs-main/node_modules/@opentelemetry/sdk-metrics/build/src/index").PeriodicExportingMetricReaderOptions`, optional)
  Options to use when creating the PeriodicExportingMetricReader to use when exporting metrics.
- **`timeoutMillis`** (`number`, optional) default: `10000ms.`
  Maximum time the OTLP exporter will wait for each batch export.
- **`url`** (`string`, optional)
  The destination URL for exporting metrics via OTLP.
- **`useDefaultFilters`** (`boolean`, optional) default: `true`
  Whether to apply predefined default filters for platform metrics.

## Related types

- [IOInsights.IOInsights.MetricsSettings](https://docs.interop.io/browser/reference/javascript/insights/metricssettings/index.md)
- [MetricFilter](https://docs.interop.io/browser/reference/javascript/io.connect%20browser/insights.metricfilter/index.md)
- [MetricPublishingSettings](https://docs.interop.io/browser/reference/javascript/insights/metricpublishingsettings/index.md)
- [MetricSettings](https://docs.interop.io/browser/reference/javascript/io.connect%20browser/insights.metricsettings/index.md)
- [Settings](https://docs.interop.io/browser/reference/javascript/insights/settings/index.md)
