You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cardinalityLimits` is an optional property in `PeriodicExportingMetricReader` that allows configuration of the maximum cardinality limits per instrument type (`InstrumentType`). This limit controls the maximum number of unique time series that can be tracked for each metric instrument. If not specified in the property, the limit will default to 2000 (the default value can also be specified).
91
+
92
+
It is converted to a `cardinalitySelector` function that:
93
+
94
+
- Takes an `InstrumentType` as input
95
+
- Returns the configured cardinality limit for that instrument type
96
+
- Falls back to the default value if a specific type isn't configured
97
+
- Uses 2000 as the default if the default value is also not specified
@@ -35,6 +36,20 @@ export type PeriodicExportingMetricReaderOptions = {
35
36
* @experimental
36
37
*/
37
38
metricProducers?: MetricProducer[];
39
+
/**
40
+
* Cardinality limits for the metric reader, applied per instrument. If not configured, defaults to 2000 time series per instrument. These are wrapped in a cardinalitySelector function that returns limits based on the instrument type, so they can be configured differently per type if desired.
41
+
*
42
+
*/
43
+
cardinalityLimits?: {
44
+
counter?: number;
45
+
gauge?: number;
46
+
histogram?: number;
47
+
upDownCounter?: number;
48
+
observableCounter?: number;
49
+
observableGauge?: number;
50
+
observableUpDownCounter?: number;
51
+
default?: number;
52
+
};
38
53
};
39
54
40
55
/**
@@ -48,14 +63,44 @@ export class PeriodicExportingMetricReader extends MetricReader {
0 commit comments