Skip to content

Commit

Permalink
Merge branch 'main' into metrics-context-circular-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo committed Aug 11, 2022
2 parents e7ee255 + 86c9f2b commit a4052af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions exporters/ostream/src/metric_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ void OStreamMetricExporter::printInstrumentationInfoMetricData(
// sout_ is shared
const std::lock_guard<opentelemetry::common::SpinLockMutex> locked(lock_);
sout_ << "{";
sout_ << "\n name\t\t: " << info_metric.scope_->GetName()
sout_ << "\n scope name\t: " << info_metric.scope_->GetName()
<< "\n schema url\t: " << info_metric.scope_->GetSchemaURL()
<< "\n version\t: " << info_metric.scope_->GetVersion();
for (const auto &record : info_metric.metric_data_)
{
sout_ << "\n start time\t: " << timeToString(record.start_ts)
<< "\n end time\t: " << timeToString(record.end_ts)
<< "\n name\t\t: " << record.instrument_descriptor.name_
<< "\n instrument name\t: " << record.instrument_descriptor.name_
<< "\n description\t: " << record.instrument_descriptor.description_
<< "\n unit\t\t: " << record.instrument_descriptor.unit_;

Expand Down
16 changes: 8 additions & 8 deletions exporters/ostream/test/ostream_metric_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ TEST(OStreamMetricsExporter, ExportSumPointData)

std::string expected_output =
"{"
"\n name\t\t: library_name"
"\n scope name\t: library_name"
"\n schema url\t: "
"\n version\t: 1.2.0"
"\n start time\t: Thu Jan 1 00:00:00 1970"
"\n end time\t: Thu Jan 1 00:00:00 1970"
"\n name\t\t: library_name"
"\n instrument name\t: library_name"
"\n description\t: description"
"\n unit\t\t: unit"
"\n type\t\t: SumPointData"
Expand Down Expand Up @@ -137,12 +137,12 @@ TEST(OStreamMetricsExporter, ExportHistogramPointData)

std::string expected_output =
"{"
"\n name\t\t: library_name"
"\n scope name\t: library_name"
"\n schema url\t: "
"\n version\t: 1.2.0"
"\n start time\t: Thu Jan 1 00:00:00 1970"
"\n end time\t: Thu Jan 1 00:00:00 1970"
"\n name\t\t: library_name"
"\n instrument name\t: library_name"
"\n description\t: description"
"\n unit\t\t: unit"
"\n type : HistogramPointData"
Expand Down Expand Up @@ -215,12 +215,12 @@ TEST(OStreamMetricsExporter, ExportLastValuePointData)

std::string expected_output =
"{"
"\n name\t\t: library_name"
"\n scope name\t: library_name"
"\n schema url\t: "
"\n version\t: 1.2.0"
"\n start time\t: Thu Jan 1 00:00:00 1970"
"\n end time\t: Thu Jan 1 00:00:00 1970"
"\n name\t\t: library_name"
"\n instrument name\t: library_name"
"\n description\t: description"
"\n unit\t\t: unit"
"\n type : LastValuePointData"
Expand Down Expand Up @@ -278,12 +278,12 @@ TEST(OStreamMetricsExporter, ExportDropPointData)

std::string expected_output =
"{"
"\n name\t\t: library_name"
"\n scope name\t: library_name"
"\n schema url\t: "
"\n version\t: 1.2.0"
"\n start time\t: Thu Jan 1 00:00:00 1970"
"\n end time\t: Thu Jan 1 00:00:00 1970"
"\n name\t\t: library_name"
"\n instrument name\t: library_name"
"\n description\t: description"
"\n unit\t\t: unit"
"\n resources\t:"
Expand Down
1 change: 1 addition & 0 deletions sdk/include/opentelemetry/sdk/metrics/instruments.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma once
#ifndef ENABLE_METRICS_PREVIEW
# include <functional>
# include "opentelemetry/sdk/common/attribute_utils.h"
OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
Expand Down

0 comments on commit a4052af

Please sign in to comment.