# Insights.MetricFilter

**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.metricfilter/index.html

Metric filters that can be specified as part of a specific metric.

## Properties

- **`additionalAttributes`** (`{ [x: string]: unknown; } | (() => { [x: string]: unknown; })`, optional)
  Additional attributes to publish with the values of the metric, specified as key/value
  pairs or as a callback returning them (called for every value). Can be specified for a
  single metric (`publishingSettings`), for all metrics (`defaultPublishingSettings`) and in
  a metric filter; the levels add up, the most specific one winning on an attribute. They are
  added when a value is published - after a filter has been matched - and go through the
  `attributeSettings` like the rest; the `additionalAttributes` of a `MetricSettings` are part
  of the value itself instead.
- **`attributes`** (`{ complexLoad?: boolean; includesFrameCreation?: boolean; } & Record<string, any>`, optional)
  Matches the attributes attached to a metric value. Not all metrics
  have all attribute values.
- **`attributeSettings`** (`{ [x: string]: IOInsights.IOInsights.MetricAttributeSettings; }`, optional)
  Controls the publishing of specific attributes, by name. An entry names an attribute by its
  flattened (dot-separated) name, or everything nested under it - `"bounds"` covers
  `"bounds.left"` - and the most specific entry is the one that applies to an attribute. See
  `MetricAttributeSettings` for what an entry does, and `attributeSettingsMode` for whether
  the entries are a block list (the default) or an allow list. Every distinct combination of attribute
  values is a time series of its own, so this is the way to keep a metric to the dimensions
  that are actually needed.

  Can be specified for a single metric (`publishingSettings`), for all metrics
  (`defaultPublishingSettings`) and in a metric filter. The levels add up by attribute name, the most
  specific one - a matching filter, then the metric, then the defaults - having the last word
  on an attribute. Applies to the attributes of the metric values; the resource attributes
  only get the `defaultPublishingSettings`, and without the allow list.
- **`attributeSettingsMode`** (`IOInsights.IOInsights.AttributeSettingsMode`, optional)
  How the `attributeSettings` read: `"blocklist"` (the default) publishes everything except
  the attributes with a `"drop"` entry - an `"allow"` entry is the exception to a broader
  `"drop"` (`"bounds"` dropped, `"bounds.width"` allowed); `"allowlist"` publishes only the
  attributes with an `"allow"` or a `"mask"` entry. The most specific level that sets it
  applies - a matching filter's, then the metric's, then the defaults'.
- **`enabled`** (`boolean`, optional)
  Whether or not the value for the matching metric will be published.
- **`name`** (`string`, optional)
  The name of the matched metric.
- **`overrideDefaultFilters`** (`boolean`, optional) default: `false`
  If `true`, this filter rule will be matched before any default filters provided
  by io.Connect. The default filters are usually meant filter out non-representative
  operations (e.g. partial workspace loads), but you can use this property to
  force them to be measured.
  If `false`, default filters will be matched before this filtering rule.
- **`sample`** (`number | boolean`, optional) default: `true`
  Defines sampling probability for the metric.
- **`type`** (`MetricType`, optional)
  The type of the metric to match.

## Related types

- [AttributeSettingsMode](https://docs.interop.io/browser/reference/javascript/insights/attributesettingsmode/index.md)
- [MetricAttributeSettings](https://docs.interop.io/browser/reference/javascript/insights/metricattributesettings/index.md)
- [MetricType](https://docs.interop.io/browser/reference/javascript/io.connect%20browser/insights.metrictype/index.md)
