Skip to content

Commit 1998fa9

Browse files
committed
Address comments
1 parent 8ba93a1 commit 1998fa9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

opentelemetry/src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
//! 3. **Record Measurements:** Use the instruments to record measurement values
5555
//! along with optional attributes.
5656
//!
57-
//! ## How Metrics Work in OpenTelemetry
57+
//! ## How Metrics work in OpenTelemetry
5858
//! In OpenTelemetry, raw measurements recorded using instruments are
5959
//! **aggregated in memory** to form metrics. These aggregated metrics are
6060
//! periodically exported by the [`opentelemetry_sdk`] at fixed intervals (e.g.,
@@ -91,6 +91,8 @@
9191
//! - An **ObservableUpDownCounter** can monitor the size of an in-memory queue
9292
//! by reporting the size using queue's len() method within the callback
9393
//! function.
94+
//! - An **ObservableGauge** can monitor the CPU temperature by using
95+
//! temperature sensor APIs within the callback function.
9496
//!
9597
//! For detailed guidance, refer to [OpenTelemetry Metrics API - Instrumentation
9698
//! Guidance](https://opentelemetry.io/docs/specs/otel/metrics/supplementary-guidelines/#instrument-selection).
@@ -109,19 +111,19 @@
109111
//! let meter = global::meter("my_service");
110112
//!
111113
//! // Create an instrument (in this case, a Counter).
112-
//! let counter = meter.u64_counter("my_counter").build();
114+
//! let counter = meter.u64_counter("request.count").build();
113115
//!
114116
//! // Record a measurement by passing the value and a set of attributes.
115117
//! counter.add(1, &[KeyValue::new("http.client_ip", "83.164.160.102")]);
116118
//!
117119
//! // Create an ObservableCounter and register a callback that reports the measurement.
118120
//! let _observable_counter = meter
119-
//! .u64_observable_counter("my_observable_counter")
121+
//! .u64_observable_counter("bytes_received")
120122
//! .with_callback(|observer| {
121123
//! observer.observe(
122124
//! 100,
123125
//! &[
124-
//! KeyValue::new("mykey1", "myvalue1"),
126+
//! KeyValue::new("protocol", "udp"),
125127
//! ],
126128
//! )
127129
//! })
@@ -151,7 +153,7 @@
151153
//! [`opentelemetry-appender-tracing`](https://crates.io/crates/opentelemetry-appender-tracing)
152154
//! crates.
153155
//!
154-
//! ## Crate Feature Flags
156+
//! # Crate Feature Flags
155157
//!
156158
//! The following core crate feature flags are available:
157159
//!
@@ -168,7 +170,7 @@
168170
//! The following feature flags enable APIs defined in OpenTelemetry specification that is in experimental phase:
169171
//! * `otel_unstable`: Includes unstable APIs. There are no features behind this flag at the moment.
170172
//!
171-
//! ## Related Crates
173+
//! # Related Crates
172174
//!
173175
//! In addition to `opentelemetry`, the [`open-telemetry/opentelemetry-rust`]
174176
//! repository contains several additional crates designed to be used with the
@@ -208,7 +210,7 @@
208210
//! [`Prometheus`]: https://prometheus.io
209211
//! [`Zipkin`]: https://zipkin.io
210212
//!
211-
//! ## Supported Rust Versions
213+
//! # Supported Rust Versions
212214
//!
213215
//! OpenTelemetry is built against the latest stable release. The minimum
214216
//! supported version is 1.70. The current OpenTelemetry version is not

0 commit comments

Comments
 (0)