Skip to content

Commit

Permalink
[currency] - fix metricreader export and temporality (#1335)
Browse files Browse the repository at this point in the history
* default metricreader and exporter options

Signed-off-by: Pierre Tessier <[email protected]>

* default metricreader and exporter options

Signed-off-by: Pierre Tessier <[email protected]>

---------

Signed-off-by: Pierre Tessier <[email protected]>
Co-authored-by: Juliano Costa <[email protected]>
  • Loading branch information
puckpuck and julianocosta89 authored Jan 19, 2024
1 parent 69a28d6 commit 0051599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ release.
([#1291](https://github.com/open-telemetry/opentelemetry-demo/pull/1291))
* [currencyservice] - add package name prefix to `rpc.service` attribute
([#1333](https://github.com/open-telemetry/opentelemetry-demo/pull/1333))
* [currency] fix metric exporter options
([#1335](https://github.com/open-telemetry/opentelemetry-demo/pull/1335))

## 1.7.2

Expand Down
7 changes: 3 additions & 4 deletions src/currencyservice/src/meter_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ namespace
{
// Build MetricExporter
otlp_exporter::OtlpGrpcMetricExporterOptions otlpOptions;

// Configuration via environment variable not supported yet
otlpOptions.aggregation_temporality = otlp_exporter::PreferredAggregationTemporality::kDelta;
//otlpOptions.aggregation_temporality = otlp_exporter::PreferredAggregationTemporality::kCumulative;
auto exporter = otlp_exporter::OtlpGrpcMetricExporterFactory::Create(otlpOptions);

// Build MeterProvider and Reader
metric_sdk::PeriodicExportingMetricReaderOptions options;
options.export_interval_millis = std::chrono::milliseconds(1000);
options.export_timeout_millis = std::chrono::milliseconds(500);
//options.export_interval_millis = std::chrono::milliseconds(60000);
//options.export_timeout_millis = std::chrono::milliseconds(30000);
std::unique_ptr<metric_sdk::MetricReader> reader{
new metric_sdk::PeriodicExportingMetricReader(std::move(exporter), options) };
auto provider = std::shared_ptr<metrics_api::MeterProvider>(new metric_sdk::MeterProvider());
Expand Down

0 comments on commit 0051599

Please sign in to comment.