diff --git a/examples/metrics_simple/README.md b/examples/metrics_simple/README.md index 7e4f832160..1e2b1517d1 100644 --- a/examples/metrics_simple/README.md +++ b/examples/metrics_simple/README.md @@ -1,5 +1,8 @@ # Simple Metrics Example +See [INSTALL.md](../../INSTALL.md) for instructions on building and +running the example. + This example initializes the metrics pipeline with 3 different instrument types: - [Counter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#counter) @@ -44,8 +47,9 @@ custom aggregation config, and attribute processor. Metrics SDK will implicitly create a missing view with default mapping between Instrument and Aggregation. ```cpp + std::string counter_name = "counter_name"; std::unique_ptr instrument_selector{ - new metric_sdk::InstrumentSelector(metric_sdk::InstrumentType::kCounter, "counter_name")}; + new metric_sdk::InstrumentSelector(metric_sdk::InstrumentType::kCounter, counter_name)}; std::unique_ptr meter_selector{ new metric_sdk::MeterSelector(name, version, schema)}; std::unique_ptr sum_view{ @@ -111,6 +115,3 @@ Ensure to keep the Instrument object active for the lifetime of collection. auto counter = meter->CreateDoubleObservableCounter(counter_name); counter->AddCallback(MeasurementFetcher::Fetcher, nullptr); ``` - -See [INSTALL.md](../../INSTALL.md) for instructions on building and -running the example.