Skip to content

Commit a2949d1

Browse files
authored
[Azure Monitor] OpenTelemetry Update Metrics Exporter aggregation temporality (Azure#26151)
Breeze require delta aggregation temporality for most instruments
1 parent 1aad5ec commit a2949d1

File tree

1 file changed

+7
-7
lines changed
  • sdk/monitor/monitor-opentelemetry-exporter/src/export

1 file changed

+7
-7
lines changed

sdk/monitor/monitor-opentelemetry-exporter/src/export/metric.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,13 @@ export class AzureMonitorMetricExporter
2424
* Flag to determine if Exporter is shutdown.
2525
*/
2626
private _isShutdown = false;
27-
/**
28-
* Aggregation temporality.
29-
*/
30-
private _aggregationTemporality: AggregationTemporality;
31-
3227
/**
3328
* Initializes a new instance of the AzureMonitorMetricExporter class.
3429
* @param AzureExporterConfig - Exporter configuration.
3530
*/
3631

3732
constructor(options: AzureMonitorExporterOptions = {}) {
3833
super(options);
39-
this._aggregationTemporality = AggregationTemporality.CUMULATIVE;
4034
diag.debug("AzureMonitorMetricExporter was successfully setup");
4135
}
4236

@@ -76,7 +70,13 @@ export class AzureMonitorMetricExporter
7670
* Select aggregation temporality
7771
*/
7872
public selectAggregationTemporality(_instrumentType: InstrumentType): AggregationTemporality {
79-
return this._aggregationTemporality;
73+
if (
74+
_instrumentType == InstrumentType.UP_DOWN_COUNTER ||
75+
_instrumentType == InstrumentType.OBSERVABLE_UP_DOWN_COUNTER
76+
) {
77+
return AggregationTemporality.CUMULATIVE;
78+
}
79+
return AggregationTemporality.DELTA;
8080
}
8181

8282
/**

0 commit comments

Comments
 (0)