diff --git a/exporters/ostream/src/metric_exporter.cc b/exporters/ostream/src/metric_exporter.cc index e05597f6ec..3b9887097b 100644 --- a/exporters/ostream/src/metric_exporter.cc +++ b/exporters/ostream/src/metric_exporter.cc @@ -127,14 +127,14 @@ void OStreamMetricExporter::printInstrumentationInfoMetricData( // sout_ is shared const std::lock_guard 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_; diff --git a/exporters/ostream/test/ostream_metric_test.cc b/exporters/ostream/test/ostream_metric_test.cc index 0dd95bc37f..ea46c09bbe 100644 --- a/exporters/ostream/test/ostream_metric_test.cc +++ b/exporters/ostream/test/ostream_metric_test.cc @@ -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" @@ -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" @@ -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" @@ -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:" diff --git a/sdk/include/opentelemetry/sdk/metrics/instruments.h b/sdk/include/opentelemetry/sdk/metrics/instruments.h index 565fd05d95..22fdba2879 100644 --- a/sdk/include/opentelemetry/sdk/metrics/instruments.h +++ b/sdk/include/opentelemetry/sdk/metrics/instruments.h @@ -3,6 +3,7 @@ #pragma once #ifndef ENABLE_METRICS_PREVIEW +# include # include "opentelemetry/sdk/common/attribute_utils.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace sdk