Skip to content

Commit bb21233

Browse files
authored
refactor(exporter-metrics-otlp-http): fix eslint warning (#5396)
1 parent e265e47 commit bb21233

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

experimental/packages/opentelemetry-exporter-metrics-otlp-http/src/OTLPMetricExporterBase.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,14 @@ function chooseTemporalitySelector(
111111
return chooseTemporalitySelectorFromEnvironment();
112112
}
113113

114+
const DEFAULT_AGGREGATION = Object.freeze({
115+
type: AggregationType.DEFAULT,
116+
});
117+
114118
function chooseAggregationSelector(
115119
config: OTLPMetricExporterOptions | undefined
116-
) {
117-
if (config?.aggregationPreference) {
118-
return config.aggregationPreference;
119-
} else {
120-
return (_instrumentType: any) => {
121-
return {
122-
type: AggregationType.DEFAULT,
123-
};
124-
};
125-
}
120+
): AggregationSelector {
121+
return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);
126122
}
127123

128124
export class OTLPMetricExporterBase

0 commit comments

Comments
 (0)