|
36 | 36 | //! ``` |
37 | 37 | //! |
38 | 38 | //! See the [examples](https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples) directory for different integration patterns. |
39 | | -//! |
| 39 | +//! |
40 | 40 | //! See the [`trace`] module docs for more information on creating and managing |
41 | 41 | //! spans. |
42 | 42 | //! |
|
62 | 62 | //! [`opentelemetry-otlp`]. This reduces reporting overhead while ensuring |
63 | 63 | //! up-to-date data. The aggregation strategy and export interval can be |
64 | 64 | //! customized in the [`opentelemetry_sdk`] based on your use case. |
65 | | -//! |
| 65 | +//! |
66 | 66 | //! ## Choosing the Right Instrument |
67 | 67 | //! Selecting the correct instrument is critical for accurately representing |
68 | 68 | //! your metrics data: |
|
75 | 75 | //! current state, such as CPU usage, temperature etc. |
76 | 76 | //! - Use **Histograms** for measuring the distribution of a value, such as |
77 | 77 | //! response times or payload sizes. |
78 | | -//! |
| 78 | +//! |
79 | 79 | //! ### Observable Instruments |
80 | | -//! |
| 80 | +//! |
81 | 81 | //! Counters, UpDownCounters, and Gauges have Observable variants that allow |
82 | 82 | //! values to be reported through a callback function. Observable instruments |
83 | 83 | //! are ideal when the metric value is managed elsewhere and needs to be |
|
113 | 113 | //! |
114 | 114 | //! // Record a measurement by passing the value and a set of attributes. |
115 | 115 | //! counter.add(1, &[KeyValue::new("http.client_ip", "83.164.160.102")]); |
116 | | -//! |
| 116 | +//! |
117 | 117 | //! // Create an ObservableCounter and register a callback that reports the measurement. |
118 | 118 | //! let _observable_counter = meter |
119 | 119 | //! .u64_observable_counter("my_observable_counter") |
|
132 | 132 | //! [examples](https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples/metrics-basic) |
133 | 133 | //! directory that show a runnable example with all type of instruments. |
134 | 134 | //! |
135 | | -//! |
| 135 | +//! |
136 | 136 | //! See the [`metrics`] module docs for more information on creating and |
137 | 137 | //! managing instruments. |
138 | 138 | //! |
|
0 commit comments