Skip to main content

MetricPublishingSettingsinterface

Controls the publishing of the metric.

Properties (4)

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

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.

attributeSettings⚓︎ { [x: string]: MetricAttributeSettings; } x x

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⚓︎ AttributeSettingsMode x x

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'.

sample⚓︎ number | boolean true x

Defines sampling probability for the metric.