Skip to content

Commit

Permalink
use opentelemetry instead of opentelemetry_api
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-cox committed Aug 24, 2023
1 parent b22f7d1 commit 675ee84
Show file tree
Hide file tree
Showing 96 changed files with 262 additions and 262 deletions.
14 changes: 7 additions & 7 deletions opentelemetry-api/src/baggage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Baggage {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::Baggage, Value};
/// use opentelemetry::{baggage::Baggage, Value};
///
/// let mut cc = Baggage::new();
/// let _ = cc.insert("my-name", "my-value");
Expand All @@ -85,7 +85,7 @@ impl Baggage {
///
/// # Examples
/// ```
/// use opentelemetry_api::{baggage::{Baggage, BaggageMetadata}, Value};
/// use opentelemetry::{baggage::{Baggage, BaggageMetadata}, Value};
///
/// let mut cc = Baggage::new();
/// let _ = cc.insert("my-name", "my-value");
Expand All @@ -105,7 +105,7 @@ impl Baggage {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::Baggage, Value};
/// use opentelemetry::{baggage::Baggage, Value};
///
/// let mut cc = Baggage::new();
/// let _ = cc.insert("my-name", "my-value");
Expand All @@ -129,7 +129,7 @@ impl Baggage {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::{Baggage, BaggageMetadata}, Value};
/// use opentelemetry::{baggage::{Baggage, BaggageMetadata}, Value};
///
/// let mut cc = Baggage::new();
/// let _ = cc.insert_with_metadata("my-name", "my-value", "test");
Expand Down Expand Up @@ -306,7 +306,7 @@ pub trait BaggageExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::BaggageExt, Context, KeyValue, Value};
/// use opentelemetry::{baggage::BaggageExt, Context, KeyValue, Value};
///
/// let cx = Context::map_current(|cx| {
/// cx.with_baggage(vec![KeyValue::new("my-name", "my-value")])
Expand All @@ -327,7 +327,7 @@ pub trait BaggageExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::BaggageExt, Context, KeyValue, Value};
/// use opentelemetry::{baggage::BaggageExt, Context, KeyValue, Value};
///
/// let cx = Context::current_with_baggage(vec![KeyValue::new("my-name", "my-value")]);
///
Expand All @@ -345,7 +345,7 @@ pub trait BaggageExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{baggage::BaggageExt, Context, KeyValue, Value};
/// use opentelemetry::{baggage::BaggageExt, Context, KeyValue, Value};
///
/// let cx = Context::map_current(|cx| cx.with_cleared_baggage());
///
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-api/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Key {
/// # Examples
///
/// ```
/// use opentelemetry_api::Key;
/// use opentelemetry::Key;
/// use std::sync::Arc;
///
/// let key1 = Key::new("my_static_str");
Expand Down Expand Up @@ -449,7 +449,7 @@ pub struct InstrumentationLibrary {
/// # Examples
///
/// ```
/// let library = opentelemetry_api::InstrumentationLibrary::new(
/// let library = opentelemetry::InstrumentationLibrary::new(
/// "my-crate",
/// Some(env!("CARGO_PKG_VERSION")),
/// Some("https://opentelemetry.io/schemas/1.17.0"),
Expand Down
16 changes: 8 additions & 8 deletions opentelemetry-api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ thread_local! {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// // Application-specific `a` and `b` values
/// #[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -93,7 +93,7 @@ impl Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// #[derive(Debug, PartialEq)]
/// struct ValueA(&'static str);
Expand Down Expand Up @@ -129,7 +129,7 @@ impl Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// // Given some value types defined in your application
/// #[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// // Given some value types defined in your application
/// #[derive(Debug, PartialEq)]
Expand All @@ -188,7 +188,7 @@ impl Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// // Given some value types defined in your application
/// #[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -228,7 +228,7 @@ impl Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// #[derive(Debug, PartialEq)]
/// struct ValueA(&'static str);
Expand All @@ -247,7 +247,7 @@ impl Context {
/// Guards do not need to be explicitly dropped:
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// #[derive(Debug, PartialEq)]
/// struct ValueA(&'static str);
Expand All @@ -274,7 +274,7 @@ impl Context {
/// entered:
///
/// ```
/// use opentelemetry_api::Context;
/// use opentelemetry::Context;
///
/// #[derive(Debug, PartialEq)]
/// struct ValueA(&'static str);
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-api/src/global/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ pub fn meter(name: impl Into<Cow<'static, str>>) -> Meter {
/// # Example
///
/// ```
/// use opentelemetry_api::global::meter_with_version;
/// use opentelemetry_api::KeyValue;
/// use opentelemetry::global::meter_with_version;
/// use opentelemetry::KeyValue;
///
/// let meter = meter_with_version(
/// "io.opentelemetry",
Expand Down
14 changes: 7 additions & 7 deletions opentelemetry-api/src/global/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
//! ```
//! # #[cfg(feature="trace")]
//! # {
//! use opentelemetry_api::trace::{Tracer, noop::NoopTracerProvider};
//! use opentelemetry_api::global;
//! use opentelemetry::trace::{Tracer, noop::NoopTracerProvider};
//! use opentelemetry::global;
//!
//! fn init_tracer() {
//! // Swap this no-op provider for your tracing service of choice (jaeger, zipkin, etc)
Expand Down Expand Up @@ -50,8 +50,8 @@
//! ```
//! # #[cfg(feature="trace")]
//! # {
//! use opentelemetry_api::trace::{Tracer, TracerProvider};
//! use opentelemetry_api::global;
//! use opentelemetry::trace::{Tracer, TracerProvider};
//! use opentelemetry::global;
//!
//! pub fn my_traced_library_function() {
//! // End users of your library will configure their global tracer provider
Expand Down Expand Up @@ -91,8 +91,8 @@
//! ```
//! # #[cfg(feature="metrics")]
//! # {
//! use opentelemetry_api::metrics::{Meter, noop::NoopMeterProvider};
//! use opentelemetry_api::{global, KeyValue};
//! use opentelemetry::metrics::{Meter, noop::NoopMeterProvider};
//! use opentelemetry::{global, KeyValue};
//!
//! fn init_meter() {
//! let provider = NoopMeterProvider::new();
Expand Down Expand Up @@ -122,7 +122,7 @@
//! ```
//! # #[cfg(feature="metrics")]
//! # {
//! use opentelemetry_api::{global, KeyValue};
//! use opentelemetry::{global, KeyValue};
//!
//! pub fn my_traced_library_function() {
//! // End users of your library will configure their global meter provider
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/logs/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub trait LoggerProvider {
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, InstrumentationLibrary, logs::LoggerProvider};
/// use opentelemetry::{global, InstrumentationLibrary, logs::LoggerProvider};
///
/// let provider = global::logger_provider();
///
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-api/src/metrics/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub trait MeterProvider {
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, metrics::MeterProvider};
/// use opentelemetry_api::KeyValue;
/// use opentelemetry::{global, metrics::MeterProvider};
/// use opentelemetry::KeyValue;
///
/// let provider = global::meter_provider();
///
Expand Down Expand Up @@ -69,7 +69,7 @@ pub trait MeterProvider {
/// Provides access to instrument instances for recording metrics.
///
/// ```
/// use opentelemetry_api::{global, KeyValue};
/// use opentelemetry::{global, KeyValue};
///
/// let meter = global::meter("my-meter");
///
Expand Down
16 changes: 8 additions & 8 deletions opentelemetry-api/src/trace/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pub trait TraceContextExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, trace::{TraceContextExt, Tracer}, Context};
/// use opentelemetry::{global, trace::{TraceContextExt, Tracer}, Context};
///
/// let tracer = global::tracer("example");
///
Expand All @@ -202,7 +202,7 @@ pub trait TraceContextExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, trace::{TraceContextExt, Tracer}, Context};
/// use opentelemetry::{global, trace::{TraceContextExt, Tracer}, Context};
///
/// fn fn_with_passed_in_context(cx: &Context) {
/// let tracer = global::tracer("example");
Expand All @@ -226,7 +226,7 @@ pub trait TraceContextExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{trace::TraceContextExt, Context};
/// use opentelemetry::{trace::TraceContextExt, Context};
///
/// // Add an event to the currently active span
/// Context::map_current(|cx| cx.span().add_event("An event!", vec![]));
Expand All @@ -238,7 +238,7 @@ pub trait TraceContextExt {
/// # Examples
///
/// ```
/// use opentelemetry_api::{trace::TraceContextExt, Context};
/// use opentelemetry::{trace::TraceContextExt, Context};
///
/// assert!(!Context::map_current(|cx| cx.has_active_span()));
/// ```
Expand Down Expand Up @@ -296,8 +296,8 @@ impl TraceContextExt for Context {
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, trace::{Span, Tracer}, KeyValue};
/// use opentelemetry_api::trace::{get_active_span, mark_span_as_active};
/// use opentelemetry::{global, trace::{Span, Tracer}, KeyValue};
/// use opentelemetry::trace::{get_active_span, mark_span_as_active};
///
/// fn my_function() {
/// let tracer = global::tracer("my-component-a");
Expand Down Expand Up @@ -326,8 +326,8 @@ pub fn mark_span_as_active<T: crate::trace::Span + Send + Sync + 'static>(span:
/// # Examples
///
/// ```
/// use opentelemetry_api::{global, trace::{Span, Tracer}, KeyValue};
/// use opentelemetry_api::trace::get_active_span;
/// use opentelemetry::{global, trace::{Span, Tracer}, KeyValue};
/// use opentelemetry::trace::get_active_span;
///
/// fn my_function() {
/// // start an active span in one function
Expand Down
12 changes: 6 additions & 6 deletions opentelemetry-api/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
//! In application code:
//!
//! ```
//! use opentelemetry_api::trace::{Tracer, noop::NoopTracerProvider};
//! use opentelemetry_api::global;
//! use opentelemetry::trace::{Tracer, noop::NoopTracerProvider};
//! use opentelemetry::global;
//!
//! fn init_tracer() {
//! // Swap this no-op provider for your tracing service of choice (jaeger, zipkin, etc)
Expand Down Expand Up @@ -43,7 +43,7 @@
//! In library code:
//!
//! ```
//! use opentelemetry_api::{global, trace::{Span, Tracer, TracerProvider}};
//! use opentelemetry::{global, trace::{Span, Tracer, TracerProvider}};
//!
//! fn my_library_function() {
//! // Use the global tracer provider to get access to the user-specified
Expand Down Expand Up @@ -100,7 +100,7 @@
//! [`Context`]: crate::Context
//!
//! ```
//! use opentelemetry_api::{global, trace::{self, Span, Status, Tracer, TracerProvider}};
//! use opentelemetry::{global, trace::{self, Span, Status, Tracer, TracerProvider}};
//!
//! fn may_error(rand: f32) {
//! if rand < 0.5 {
Expand Down Expand Up @@ -131,7 +131,7 @@
//! managing the parent context.
//!
//! ```
//! use opentelemetry_api::{global, trace::Tracer};
//! use opentelemetry::{global, trace::Tracer};
//!
//! // Get a tracer
//! let tracer = global::tracer("my_tracer");
Expand All @@ -148,7 +148,7 @@
//! Async spans can be propagated with [`TraceContextExt`] and [`FutureExt`].
//!
//! ```
//! use opentelemetry_api::{Context, global, trace::{FutureExt, TraceContextExt, Tracer}};
//! use opentelemetry::{Context, global, trace::{FutureExt, TraceContextExt, Tracer}};
//!
//! async fn some_work() { }
//!
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/trace/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl Status {
/// # Examples
///
/// ```
/// use opentelemetry_api::trace::Status;
/// use opentelemetry::trace::Status;
///
/// // record error with `str` description
/// let error_status = Status::error("something went wrong");
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-api/src/trace/span_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl TraceId {
/// # Examples
///
/// ```
/// use opentelemetry_api::trace::TraceId;
/// use opentelemetry::trace::TraceId;
///
/// assert!(TraceId::from_hex("42").is_ok());
/// assert!(TraceId::from_hex("58406520a006649127e371903a2de979").is_ok());
Expand Down Expand Up @@ -169,7 +169,7 @@ impl SpanId {
/// # Examples
///
/// ```
/// use opentelemetry_api::trace::SpanId;
/// use opentelemetry::trace::SpanId;
///
/// assert!(SpanId::from_hex("42").is_ok());
/// assert!(SpanId::from_hex("58406520a0066491").is_ok());
Expand Down Expand Up @@ -264,7 +264,7 @@ impl TraceState {
/// # Examples
///
/// ```
/// use opentelemetry_api::trace::TraceState;
/// use opentelemetry::trace::TraceState;
///
/// let kvs = vec![("foo", "bar"), ("apple", "banana")];
/// let trace_state = TraceState::from_key_value(kvs);
Expand Down
Loading

0 comments on commit 675ee84

Please sign in to comment.