Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Oct 10, 2022
1 parent 2043e41 commit 5fc0812
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/src/metrics/meter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ std::unique_ptr<AsyncWritableMetricStorage> Meter::RegisterAsyncMetricStorage(
std::vector<MetricData> Meter::Collect(CollectorHandle *collector,
opentelemetry::common::SystemTimestamp collect_ts) noexcept
{
std::lock_guard<opentelemetry::common::SpinLockMutex> guard(storage_lock_);
observable_registry_->Observe(collect_ts);
std::vector<MetricData> metric_data_list;
auto ctx = meter_context_.lock();
Expand All @@ -305,6 +304,7 @@ std::vector<MetricData> Meter::Collect(CollectorHandle *collector,
<< "The metric context is invalid");
return std::vector<MetricData>{};
}
std::lock_guard<opentelemetry::common::SpinLockMutex> guard(storage_lock_);
for (auto &metric_storage : storage_registry_)
{
metric_storage.second->Collect(collector, ctx->GetCollectors(), ctx->GetSDKStartTime(),
Expand Down

0 comments on commit 5fc0812

Please sign in to comment.