Skip to content

Commit

Permalink
Stabilize Gauge (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla authored May 2, 2024
1 parent 9eb548a commit 0b78252
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions examples/metrics-basic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
// Note that there is no ObservableHistogram instrument.

// Create a Gauge Instrument.
// Note that the Gauge instrument is experimental, and can be changed/removed in the future releases.
#[cfg(feature = "otel_unstable")]
{
let gauge = meter
.f64_gauge("my_gauge")
Expand Down
1 change: 1 addition & 0 deletions opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [#1623](https://github.com/open-telemetry/opentelemetry-rust/pull/1623) Add global::meter_provider_shutdown
- [#1640](https://github.com/open-telemetry/opentelemetry-rust/pull/1640) Add `PropagationError`
- [#1701](https://github.com/open-telemetry/opentelemetry-rust/pull/1701) `Gauge` no longer requires `otel-unstable` feature flag, as OpenTelemetry specification for `Gauge` instrumentation is stable.

### Removed

Expand Down
15 changes: 2 additions & 13 deletions opentelemetry/src/metrics/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use std::any::Any;
use std::borrow::Cow;
use std::sync::Arc;

#[cfg(feature = "otel_unstable")]
use crate::metrics::Gauge;
use crate::metrics::{
AsyncInstrumentBuilder, Counter, Histogram, InstrumentBuilder, InstrumentProvider,
AsyncInstrumentBuilder, Counter, Gauge, Histogram, InstrumentBuilder, InstrumentProvider,
ObservableCounter, ObservableGauge, ObservableUpDownCounter, Result, UpDownCounter,
};
use crate::KeyValue;
Expand Down Expand Up @@ -335,32 +333,23 @@ impl Meter {
AsyncInstrumentBuilder::new(self, name.into())
}

/// # Experimental
/// This method is experimental and can be changed/removed in future releases.
/// creates an instrument builder for recording independent values.
#[cfg(feature = "otel_unstable")]
pub fn u64_gauge(
&self,
name: impl Into<Cow<'static, str>>,
) -> InstrumentBuilder<'_, Gauge<u64>> {
InstrumentBuilder::new(self, name.into())
}

/// # Experimental
/// This method is experimental and can be changed/removed in future releases.
/// creates an instrument builder for recording independent values.
#[cfg(feature = "otel_unstable")]
pub fn f64_gauge(
&self,
name: impl Into<Cow<'static, str>>,
) -> InstrumentBuilder<'_, Gauge<f64>> {
InstrumentBuilder::new(self, name.into())
}

/// # Experimental
/// This method is experimental and can be changed/removed in future releases.
/// creates an instrument builder for recording indenpendent values.
#[cfg(feature = "otel_unstable")]
/// creates an instrument builder for recording independent values.
pub fn i64_gauge(
&self,
name: impl Into<Cow<'static, str>>,
Expand Down

0 comments on commit 0b78252

Please sign in to comment.