Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize Gauge #1701

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading