Last date modified: 2025-Jul-02

Interface: IMetricsApi

Experimental

API for managing application metrics This API is in preview and not ready for production use. Expect breaking changes in the future.

Properties

attributes

readonlyattributes: Readonly<IContext>

Experimental

Global metric attributes

These attributes are applied to all metrics when they are reported.

Methods

getMetricAttributes()

getMetricAttributes(metricName): Readonly<IContext>

Experimental

Parameters

metricName: string

Metric name to retrieve global attributes for

Returns

Readonly<IContext>

Metric-specific global attributes for the metric


removeAttribute()

removeAttribute(key): this

Experimental

Parameters

key: string

Attribute name

Returns

this

Reference to the service for method-chaining


removeMetricAttribute()

removeMetricAttribute(metricName, key): this

Experimental

Parameters

metricName: string

Metric name

key: string

Attribute name

Returns

this

Reference to the service for method-chaining


setAttribute()

setAttribute(key, value, override?): this

Experimental

Parameters

key: string

Attribute name

value: ApmCustomData

Attribute value

override?: boolean

Whether or not to override the attribute if it already exists (default: false)

Returns

this

Reference to the service for method-chaining


setMetricAttribute()

setMetricAttribute(metricName, key, value, override?): this

Experimental

Parameters

metricName: string

Metric name

key: string

Attribute name

value: ApmCustomData

Attribute value

override?: boolean

Whether or not to override the attribute if it already exists (default: false)

Returns

this

Reference to the service for method-chaining

Return to top of the page
Feedback