Skip to content

Commit

Permalink
Optimizing the AggregationTemporality type for Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiguo committed Jan 10, 2025
1 parent c54db05 commit af53bb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class OtlpGrpcExporterFactory implements ExporterFactory {
public MetricReader create(CounterConfig config) {
ExporterConfig exporterConfig = config.getExporter();
MetricExporter exporter = OtlpGrpcMetricExporter.builder().setEndpoint(exporterConfig.getEndpoint()).
setAggregationTemporalitySelector(AggregationTemporalitySelector.deltaPreferred()).
setAggregationTemporalitySelector(AggregationTemporalitySelector.alwaysCumulative()).
setTimeout(Duration.ofMillis(exporterConfig.getTimeout())).build();
return PeriodicMetricReader.builder(exporter).setInterval(Duration.ofMillis(config.getReaderInterval())).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class OtlpHttpExporterFactory implements ExporterFactory {
public MetricReader create(CounterConfig config) {
ExporterConfig exporterConfig = config.getExporter();
MetricExporter exporter = OtlpHttpMetricExporter.builder().setEndpoint(exporterConfig.getEndpoint()).
setAggregationTemporalitySelector(AggregationTemporalitySelector.deltaPreferred()).
setAggregationTemporalitySelector(AggregationTemporalitySelector.alwaysCumulative()).
setTimeout(Duration.ofMillis(exporterConfig.getTimeout())).build();
return PeriodicMetricReader.builder(exporter).setInterval(Duration.ofMillis(config.getReaderInterval())).build();
}
Expand Down

0 comments on commit af53bb0

Please sign in to comment.