diff --git a/opentelemetry-contrib/Cargo.toml b/opentelemetry-contrib/Cargo.toml index ad90085330..91029fa718 100644 --- a/opentelemetry-contrib/Cargo.toml +++ b/opentelemetry-contrib/Cargo.toml @@ -23,17 +23,17 @@ default = [] base64_format = ["base64", "binary_propagator"] binary_propagator = [] jaeger_json_exporter = ["serde_json", "futures-core", "futures-util", "async-trait", "opentelemetry-semantic-conventions"] -rt-tokio = ["tokio", "opentelemetry/rt-tokio"] -rt-tokio-current-thread = ["tokio", "opentelemetry/rt-tokio-current-thread"] -rt-async-std = ["async-std", "opentelemetry/rt-async-std"] +rt-tokio = ["tokio", "opentelemetry_sdk/rt-tokio"] +rt-tokio-current-thread = ["tokio", "opentelemetry_sdk/rt-tokio-current-thread"] +rt-async-std = ["async-std", "opentelemetry_sdk/rt-async-std"] [dependencies] async-std = { version = "1.10", optional = true } async-trait = { version = "0.1", optional = true } base64 = { version = "0.13", optional = true } once_cell = "1.17.1" -opentelemetry = { version = "0.20", path = "../opentelemetry", features = ["trace"] } opentelemetry_api = { version = "0.20", path = "../opentelemetry-api" } +opentelemetry_sdk = { version = "0.20", path = "../opentelemetry-sdk" } opentelemetry-semantic-conventions = { version = "0.12", path = "../opentelemetry-semantic-conventions", optional = true } serde_json = { version = "1", optional = true } tokio = { version = "1.0", features = ["fs", "io-util"], optional = true } @@ -44,4 +44,4 @@ futures-util = { version = "0.3", optional = true } [dev-dependencies] base64 = "0.13" -opentelemetry = { path = "../opentelemetry", features = ["trace", "testing"] } +opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["trace", "testing"] } diff --git a/opentelemetry-contrib/src/trace/exporter/jaeger_json.rs b/opentelemetry-contrib/src/trace/exporter/jaeger_json.rs index de15fcee63..1419bad588 100644 --- a/opentelemetry-contrib/src/trace/exporter/jaeger_json.rs +++ b/opentelemetry-contrib/src/trace/exporter/jaeger_json.rs @@ -4,10 +4,12 @@ use async_trait::async_trait; use futures_core::future::BoxFuture; use futures_util::FutureExt; -use opentelemetry::runtime::RuntimeChannel; -use opentelemetry::sdk::export::trace::{ExportResult, SpanData, SpanExporter}; -use opentelemetry::sdk::trace::{BatchMessage, Tracer}; -use opentelemetry::trace::{SpanId, TraceError}; +use opentelemetry_api::trace::{SpanId, TraceError}; +use opentelemetry_sdk::{ + export::trace::{ExportResult, SpanData, SpanExporter}, + runtime::RuntimeChannel, + trace::{BatchMessage, Tracer, TracerProvider}, +}; use opentelemetry_semantic_conventions::SCHEMA_URL; use std::collections::HashMap; use std::path::{Path, PathBuf}; @@ -40,21 +42,17 @@ impl JaegerJsonExporter { /// Install the exporter using the internal provided runtime pub fn install_batch(self) -> Tracer { - use opentelemetry::trace::TracerProvider; - let runtime = self.runtime.clone(); - let provider_builder = - opentelemetry::sdk::trace::TracerProvider::builder().with_batch_exporter(self, runtime); - + let provider_builder = TracerProvider::builder().with_batch_exporter(self, runtime); let provider = provider_builder.build(); - - let tracer = provider.versioned_tracer( + let tracer = opentelemetry_api::trace::TracerProvider::versioned_tracer( + &provider, "opentelemetry", Some(env!("CARGO_PKG_VERSION")), Some(SCHEMA_URL), None, ); - let _ = opentelemetry::global::set_tracer_provider(provider); + let _ = opentelemetry_api::global::set_tracer_provider(provider); tracer } @@ -120,9 +118,7 @@ impl SpanExporter for JaegerJsonExporter { } } -fn span_data_to_jaeger_json( - span: opentelemetry::sdk::export::trace::SpanData, -) -> serde_json::Value { +fn span_data_to_jaeger_json(span: SpanData) -> serde_json::Value { let events = span .events .iter() @@ -203,13 +199,13 @@ fn span_data_to_jaeger_json( }) } -fn opentelemetry_value_to_json(value: &opentelemetry::Value) -> (&str, serde_json::Value) { +fn opentelemetry_value_to_json(value: &opentelemetry_api::Value) -> (&str, serde_json::Value) { match value { - opentelemetry::Value::Bool(b) => ("bool", serde_json::json!(b)), - opentelemetry::Value::I64(i) => ("int64", serde_json::json!(i)), - opentelemetry::Value::F64(f) => ("float64", serde_json::json!(f)), - opentelemetry::Value::String(s) => ("string", serde_json::json!(s.as_str())), - v @ opentelemetry::Value::Array(_) => ("string", serde_json::json!(v.to_string())), + opentelemetry_api::Value::Bool(b) => ("bool", serde_json::json!(b)), + opentelemetry_api::Value::I64(i) => ("int64", serde_json::json!(i)), + opentelemetry_api::Value::F64(f) => ("float64", serde_json::json!(f)), + opentelemetry_api::Value::String(s) => ("string", serde_json::json!(s.as_str())), + v @ opentelemetry_api::Value::Array(_) => ("string", serde_json::json!(v.to_string())), } } @@ -226,7 +222,7 @@ pub trait JaegerJsonRuntime: RuntimeChannel + std::fmt::Debug { #[cfg(feature = "rt-tokio")] #[async_trait] -impl JaegerJsonRuntime for opentelemetry::runtime::Tokio { +impl JaegerJsonRuntime for opentelemetry_sdk::runtime::Tokio { async fn create_dir(&self, path: &Path) -> ExportResult { if tokio::fs::metadata(path).await.is_err() { tokio::fs::create_dir_all(path) @@ -256,7 +252,7 @@ impl JaegerJsonRuntime for opentelemetry::runtime::Tokio { #[cfg(feature = "rt-tokio-current-thread")] #[async_trait] -impl JaegerJsonRuntime for opentelemetry::runtime::TokioCurrentThread { +impl JaegerJsonRuntime for opentelemetry_sdk::runtime::TokioCurrentThread { async fn create_dir(&self, path: &Path) -> ExportResult { if tokio::fs::metadata(path).await.is_err() { tokio::fs::create_dir_all(path) @@ -286,7 +282,7 @@ impl JaegerJsonRuntime for opentelemetry::runtime::TokioCurrentThread { #[cfg(feature = "rt-async-std")] #[async_trait] -impl JaegerJsonRuntime for opentelemetry::runtime::AsyncStd { +impl JaegerJsonRuntime for opentelemetry_sdk::runtime::AsyncStd { async fn create_dir(&self, path: &Path) -> ExportResult { if async_std::fs::metadata(path).await.is_err() { async_std::fs::create_dir_all(path) diff --git a/opentelemetry-contrib/src/trace/propagator/binary/base64_format.rs b/opentelemetry-contrib/src/trace/propagator/binary/base64_format.rs index 45712b5ebf..a07ff94e04 100644 --- a/opentelemetry-contrib/src/trace/propagator/binary/base64_format.rs +++ b/opentelemetry-contrib/src/trace/propagator/binary/base64_format.rs @@ -10,7 +10,7 @@ use crate::trace::propagator::binary::binary_propagator::BinaryFormat; use base64::{decode, encode}; -use opentelemetry::trace::SpanContext; +use opentelemetry_api::trace::SpanContext; /// Used to serialize and deserialize `SpanContext`s to and from a base64 /// representation. @@ -43,7 +43,7 @@ where mod tests { use super::*; use crate::trace::propagator::binary::binary_propagator::BinaryPropagator; - use opentelemetry::trace::{SpanId, TraceFlags, TraceId, TraceState}; + use opentelemetry_api::trace::{SpanId, TraceFlags, TraceId, TraceState}; #[rustfmt::skip] fn to_base64_data() -> Vec<(SpanContext, String)> { diff --git a/opentelemetry-contrib/src/trace/propagator/binary/binary_propagator.rs b/opentelemetry-contrib/src/trace/propagator/binary/binary_propagator.rs index 2f8eba7342..60196dbc88 100644 --- a/opentelemetry-contrib/src/trace/propagator/binary/binary_propagator.rs +++ b/opentelemetry-contrib/src/trace/propagator/binary/binary_propagator.rs @@ -5,7 +5,7 @@ //! //! `BinaryFormat` MUST expose the APIs that serializes values into bytes, //! and deserializes values from bytes. -use opentelemetry::trace::{SpanContext, SpanId, TraceFlags, TraceId, TraceState}; +use opentelemetry_api::trace::{SpanContext, SpanId, TraceFlags, TraceId, TraceState}; use std::convert::TryInto; /// Used to serialize and deserialize `SpanContext`s to and from a binary @@ -88,7 +88,7 @@ impl BinaryFormat for BinaryPropagator { #[cfg(test)] mod tests { use super::*; - use opentelemetry::trace::TraceState; + use opentelemetry_api::trace::TraceState; #[rustfmt::skip] fn to_bytes_data() -> Vec<(SpanContext, [u8; 29])> { diff --git a/opentelemetry-contrib/src/trace/propagator/trace_context_response.rs b/opentelemetry-contrib/src/trace/propagator/trace_context_response.rs index 68479d6d58..0a54c1af31 100644 --- a/opentelemetry-contrib/src/trace/propagator/trace_context_response.rs +++ b/opentelemetry-contrib/src/trace/propagator/trace_context_response.rs @@ -12,10 +12,9 @@ //! //! [w3c trace-context docs]: https://w3c.github.io/trace-context/#traceresponse-header use once_cell::sync::Lazy; -use opentelemetry::trace::{SpanContext, SpanId, TraceId, TraceState}; use opentelemetry_api::{ propagation::{text_map_propagator::FieldIter, Extractor, Injector, TextMapPropagator}, - trace::{TraceContextExt, TraceFlags}, + trace::{SpanContext, SpanId, TraceContextExt, TraceFlags, TraceId, TraceState}, Context, }; @@ -132,11 +131,11 @@ impl TextMapPropagator for TraceContextResponsePropagator { #[cfg(test)] mod tests { use super::*; - use opentelemetry::{testing::trace::TestSpan, trace::TraceState}; use opentelemetry_api::{ propagation::{Extractor, TextMapPropagator}, trace::{SpanContext, SpanId, TraceId}, }; + use opentelemetry_api::{testing::trace::TestSpan, trace::TraceState}; use std::{collections::HashMap, str::FromStr}; #[rustfmt::skip] diff --git a/opentelemetry-datadog/Cargo.toml b/opentelemetry-datadog/Cargo.toml index 6ebaa5c765..367355063e 100644 --- a/opentelemetry-datadog/Cargo.toml +++ b/opentelemetry-datadog/Cargo.toml @@ -24,9 +24,10 @@ reqwest-client = ["reqwest", "opentelemetry-http/reqwest"] surf-client = ["surf", "opentelemetry-http/surf"] [dependencies] -indexmap = "1.8" +indexmap = "2.0" once_cell = "1.12" -opentelemetry = { version = "0.20", path = "../opentelemetry", features = ["trace"] } +opentelemetry_api = { version = "0.20", path = "../opentelemetry-api", features = ["trace"] } +opentelemetry_sdk = { version = "0.20", path = "../opentelemetry-sdk", features = ["trace"] } opentelemetry-http = { version = "0.9", path = "../opentelemetry-http" } opentelemetry-semantic-conventions = { version = "0.12", path = "../opentelemetry-semantic-conventions" } rmp = "0.8" @@ -34,7 +35,7 @@ url = "2.2" reqwest = { version = "0.11", default-features = false, optional = true } surf = { version = "2.0", default-features = false, optional = true } thiserror = "1.0" -itertools = "0.10" +itertools = "0.11" http = "0.2" futures-core = "0.3" @@ -44,7 +45,7 @@ base64 = "0.13" bytes = "1" futures-util = { version = "0.3", features = ["io"] } isahc = "1.4" -opentelemetry = { path = "../opentelemetry", features = ["trace", "testing"] } +opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["trace", "testing"] } [[example]] name = "datadog" diff --git a/opentelemetry-datadog/examples/datadog.rs b/opentelemetry-datadog/examples/datadog.rs index 5cb1400c5e..9ba60da834 100644 --- a/opentelemetry-datadog/examples/datadog.rs +++ b/opentelemetry-datadog/examples/datadog.rs @@ -1,6 +1,5 @@ -use opentelemetry::global; -use opentelemetry::global::shutdown_tracer_provider; -use opentelemetry::{ +use opentelemetry_api::{ + global::{self, shutdown_tracer_provider}, trace::{Span, TraceContextExt, Tracer}, Key, }; diff --git a/opentelemetry-datadog/src/exporter/mod.rs b/opentelemetry-datadog/src/exporter/mod.rs index 4442f78dfd..d9e2120ee3 100644 --- a/opentelemetry-datadog/src/exporter/mod.rs +++ b/opentelemetry-datadog/src/exporter/mod.rs @@ -4,25 +4,23 @@ mod model; pub use model::ApiVersion; pub use model::Error; pub use model::FieldMappingFn; -use opentelemetry::runtime::RuntimeChannel; - -use std::borrow::Cow; -use std::fmt::{Debug, Formatter}; use crate::exporter::model::FieldMapping; use futures_core::future::BoxFuture; use http::{Method, Request, Uri}; use itertools::Itertools; -use opentelemetry::sdk::export::trace; -use opentelemetry::sdk::export::trace::SpanData; -use opentelemetry::sdk::resource::ResourceDetector; -use opentelemetry::sdk::resource::SdkProvidedResourceDetector; -use opentelemetry::sdk::trace::{BatchMessage, Config}; -use opentelemetry::sdk::Resource; -use opentelemetry::trace::TraceError; -use opentelemetry::{global, sdk, trace::TracerProvider, KeyValue}; +use opentelemetry_api::{global, trace::TraceError, KeyValue}; use opentelemetry_http::{HttpClient, ResponseExt}; +use opentelemetry_sdk::{ + export::trace::{ExportResult, SpanData, SpanExporter}, + resource::{ResourceDetector, SdkProvidedResourceDetector}, + runtime::RuntimeChannel, + trace::{BatchMessage, Config, Tracer, TracerProvider}, + Resource, +}; use opentelemetry_semantic_conventions as semcov; +use std::borrow::Cow; +use std::fmt::{Debug, Formatter}; use std::sync::Arc; use std::time::Duration; use url::Url; @@ -143,7 +141,7 @@ pub fn new_pipeline() -> DatadogPipelineBuilder { /// Builder for `ExporterConfig` struct. pub struct DatadogPipelineBuilder { agent_endpoint: String, - trace_config: Option, + trace_config: Option, api_version: ApiVersion, client: Option>, mapping: Mapping, @@ -283,14 +281,14 @@ impl DatadogPipelineBuilder { } /// Install the Datadog trace exporter pipeline using a simple span processor. - pub fn install_simple(mut self) -> Result { + pub fn install_simple(mut self) -> Result { let (config, service_name) = self.build_config_and_service_name(); let exporter = self.build_exporter_with_service_name(service_name)?; - let mut provider_builder = - sdk::trace::TracerProvider::builder().with_simple_exporter(exporter); + let mut provider_builder = TracerProvider::builder().with_simple_exporter(exporter); provider_builder = provider_builder.with_config(config); let provider = provider_builder.build(); - let tracer = provider.versioned_tracer( + let tracer = opentelemetry_api::trace::TracerProvider::versioned_tracer( + &provider, "opentelemetry-datadog", Some(env!("CARGO_PKG_VERSION")), Some(semcov::SCHEMA_URL), @@ -305,14 +303,14 @@ impl DatadogPipelineBuilder { pub fn install_batch>( mut self, runtime: R, - ) -> Result { + ) -> Result { let (config, service_name) = self.build_config_and_service_name(); let exporter = self.build_exporter_with_service_name(service_name)?; - let mut provider_builder = - sdk::trace::TracerProvider::builder().with_batch_exporter(exporter, runtime); + let mut provider_builder = TracerProvider::builder().with_batch_exporter(exporter, runtime); provider_builder = provider_builder.with_config(config); let provider = provider_builder.build(); - let tracer = provider.versioned_tracer( + let tracer = opentelemetry_api::trace::TracerProvider::versioned_tracer( + &provider, "opentelemetry-datadog", Some(env!("CARGO_PKG_VERSION")), Some(semcov::SCHEMA_URL), @@ -358,7 +356,7 @@ impl DatadogPipelineBuilder { } /// Assign the SDK trace configuration - pub fn with_trace_config(mut self, config: sdk::trace::Config) -> Self { + pub fn with_trace_config(mut self, config: Config) -> Self { self.trace_config = Some(config); self } @@ -411,14 +409,14 @@ fn group_into_traces(spans: Vec) -> Vec> { async fn send_request( client: Arc, request: http::Request>, -) -> trace::ExportResult { +) -> ExportResult { let _ = client.send(request).await?.error_for_status()?; Ok(()) } -impl trace::SpanExporter for DatadogExporter { +impl SpanExporter for DatadogExporter { /// Export spans to datadog-agent - fn export(&mut self, batch: Vec) -> BoxFuture<'static, trace::ExportResult> { + fn export(&mut self, batch: Vec) -> BoxFuture<'static, ExportResult> { let request = match self.build_request(batch) { Ok(req) => req, Err(err) => return Box::pin(std::future::ready(Err(err))), diff --git a/opentelemetry-datadog/src/exporter/model/mod.rs b/opentelemetry-datadog/src/exporter/model/mod.rs index 7c87bdad93..a0dca88707 100644 --- a/opentelemetry-datadog/src/exporter/model/mod.rs +++ b/opentelemetry-datadog/src/exporter/model/mod.rs @@ -1,6 +1,6 @@ use crate::exporter::ModelConfig; use http::uri; -use opentelemetry::sdk::export::{ +use opentelemetry_sdk::export::{ trace::{self, SpanData}, ExportError, }; @@ -189,12 +189,15 @@ impl ApiVersion { #[cfg(test)] pub(crate) mod tests { use super::*; - use opentelemetry::sdk::InstrumentationLibrary; - use opentelemetry::sdk::{self, Resource}; - use opentelemetry::{ + use opentelemetry_api::{ trace::{SpanContext, SpanId, SpanKind, Status, TraceFlags, TraceId, TraceState}, Key, KeyValue, }; + use opentelemetry_sdk::{ + self, + trace::{EvictedHashMap, EvictedQueue}, + InstrumentationLibrary, Resource, + }; use std::borrow::Cow; use std::time::{Duration, SystemTime}; @@ -215,11 +218,11 @@ pub(crate) mod tests { let end_time = start_time.checked_add(Duration::from_secs(1)).unwrap(); let capacity = 3; - let mut attributes = sdk::trace::EvictedHashMap::new(capacity, capacity as usize); + let mut attributes = EvictedHashMap::new(capacity, capacity as usize); attributes.insert(Key::new("span.type").string("web")); - let events = sdk::trace::EvictedQueue::new(capacity); - let links = sdk::trace::EvictedQueue::new(capacity); + let events = EvictedQueue::new(capacity); + let links = EvictedQueue::new(capacity); let resource = Resource::new(vec![KeyValue::new("host.name", "test")]); trace::SpanData { diff --git a/opentelemetry-datadog/src/exporter/model/v03.rs b/opentelemetry-datadog/src/exporter/model/v03.rs index 26d4b47497..81b0cdb41f 100644 --- a/opentelemetry-datadog/src/exporter/model/v03.rs +++ b/opentelemetry-datadog/src/exporter/model/v03.rs @@ -1,14 +1,12 @@ use crate::exporter::model::{Error, SAMPLING_PRIORITY_KEY}; use crate::exporter::ModelConfig; -use opentelemetry::sdk::export::trace; -use opentelemetry::sdk::export::trace::SpanData; -use opentelemetry::trace::Status; -use opentelemetry::{Key, Value}; +use opentelemetry_api::{trace::Status, Key, Value}; +use opentelemetry_sdk::export::trace::SpanData; use std::time::SystemTime; pub(crate) fn encode( model_config: &ModelConfig, - traces: Vec>, + traces: Vec>, get_service_name: S, get_name: N, get_resource: R, diff --git a/opentelemetry-datadog/src/exporter/model/v05.rs b/opentelemetry-datadog/src/exporter/model/v05.rs index 6c48844d3a..94e9690173 100644 --- a/opentelemetry-datadog/src/exporter/model/v05.rs +++ b/opentelemetry-datadog/src/exporter/model/v05.rs @@ -1,10 +1,8 @@ use crate::exporter::intern::StringInterner; use crate::exporter::model::SAMPLING_PRIORITY_KEY; use crate::exporter::{Error, ModelConfig}; -use opentelemetry::sdk::export::trace; -use opentelemetry::sdk::export::trace::SpanData; -use opentelemetry::trace::Status; -use opentelemetry::{Key, Value}; +use opentelemetry_api::{trace::Status, Key, Value}; +use opentelemetry_sdk::export::trace::SpanData; use std::time::SystemTime; use super::unified_tags::{UnifiedTagField, UnifiedTags}; @@ -58,7 +56,7 @@ const SPAN_NUM_ELEMENTS: u32 = 12; // pub(crate) fn encode( model_config: &ModelConfig, - traces: Vec>, + traces: Vec>, get_service_name: S, get_name: N, get_resource: R, @@ -122,7 +120,7 @@ fn encode_traces( get_service_name: S, get_name: N, get_resource: R, - traces: Vec>, + traces: Vec>, unified_tags: &UnifiedTags, ) -> Result, Error> where diff --git a/opentelemetry-datadog/src/lib.rs b/opentelemetry-datadog/src/lib.rs index ad1551fc87..2e3069d96f 100644 --- a/opentelemetry-datadog/src/lib.rs +++ b/opentelemetry-datadog/src/lib.rs @@ -144,7 +144,7 @@ pub use propagator::DatadogPropagator; mod propagator { use once_cell::sync::Lazy; - use opentelemetry::{ + use opentelemetry_api::{ propagation::{text_map_propagator::FieldIter, Extractor, Injector, TextMapPropagator}, trace::{SpanContext, SpanId, TraceContextExt, TraceFlags, TraceId, TraceState}, Context, @@ -317,8 +317,8 @@ mod propagator { #[cfg(test)] mod tests { use super::*; - use opentelemetry::testing::trace::TestSpan; - use opentelemetry::trace::TraceState; + use opentelemetry_api::trace::TraceState; + use opentelemetry_sdk::testing::trace::TestSpan; use std::collections::HashMap; #[rustfmt::skip] diff --git a/opentelemetry-jaeger/Cargo.toml b/opentelemetry-jaeger/Cargo.toml index 13b8cb738b..b1d6874b75 100644 --- a/opentelemetry-jaeger/Cargo.toml +++ b/opentelemetry-jaeger/Cargo.toml @@ -29,7 +29,8 @@ hyper = { version = "0.14", default-features = false, features = ["client"], opt hyper-tls = { version = "0.5.0", default-features = false, optional = true } isahc = { version = "1.4", default-features = false, optional = true } js-sys = { version = "0.3", optional = true } -opentelemetry = { version = "0.20", default-features = false, features = ["trace"], path = "../opentelemetry" } +opentelemetry_api = { version = "0.20", default-features = false, features = ["trace"], path = "../opentelemetry-api" } +opentelemetry_sdk = { version = "0.20", default-features = false, features = ["trace"], path = "../opentelemetry-sdk" } opentelemetry-http = { version = "0.9", path = "../opentelemetry-http", optional = true } opentelemetry-semantic-conventions = { version = "0.12", path = "../opentelemetry-semantic-conventions" } pin-project-lite = { version = "0.2", optional = true } @@ -53,7 +54,7 @@ futures-util = { version = "0.3", default-features = false, features = ["std", " tokio = { version = "1.0", features = ["net", "sync"] } bytes = "1" futures-executor = "0.3" -opentelemetry = { default-features = false, features = ["trace", "testing"], path = "../opentelemetry" } +opentelemetry_sdk = { default-features = false, features = ["trace", "testing"], path = "../opentelemetry-sdk" } [dependencies.web-sys] version = "0.3.4" @@ -102,7 +103,7 @@ wasm_collector_client = [ "wasm-bindgen-futures", "web-sys", ] -rt-tokio = ["tokio", "opentelemetry/rt-tokio"] -rt-tokio-current-thread = ["tokio", "opentelemetry/rt-tokio-current-thread"] -rt-async-std = ["async-std", "opentelemetry/rt-async-std"] +rt-tokio = ["tokio", "opentelemetry_sdk/rt-tokio"] +rt-tokio-current-thread = ["tokio", "opentelemetry_sdk/rt-tokio-current-thread"] +rt-async-std = ["async-std", "opentelemetry_sdk/rt-async-std"] integration_test = ["tonic", "prost", "prost-types", "rt-tokio", "collector_client", "hyper_collector_client", "hyper_tls_collector_client", "reqwest_collector_client", "surf_collector_client", "isahc_collector_client"] diff --git a/opentelemetry-jaeger/src/exporter/collector.rs b/opentelemetry-jaeger/src/exporter/collector.rs index 454732572b..dc8800d874 100644 --- a/opentelemetry-jaeger/src/exporter/collector.rs +++ b/opentelemetry-jaeger/src/exporter/collector.rs @@ -14,7 +14,7 @@ pub(crate) use wasm_collector_client::WasmCollector; mod collector_client { use super::*; use crate::exporter::thrift::jaeger; - use opentelemetry::sdk::export::trace::ExportResult; + use opentelemetry_sdk::export::trace::ExportResult; use std::io::Cursor; use std::sync::atomic::{AtomicUsize, Ordering}; use thrift::protocol::TBinaryOutputProtocol; diff --git a/opentelemetry-jaeger/src/exporter/config/agent.rs b/opentelemetry-jaeger/src/exporter/config/agent.rs index a0e569e83e..4427363020 100644 --- a/opentelemetry-jaeger/src/exporter/config/agent.rs +++ b/opentelemetry-jaeger/src/exporter/config/agent.rs @@ -5,9 +5,12 @@ use crate::exporter::config::{ }; use crate::exporter::uploader::{AsyncUploader, SyncUploader, Uploader}; use crate::{Error, Exporter, JaegerTraceRuntime}; -use opentelemetry::sdk; -use opentelemetry::sdk::trace::{BatchConfig, Config, TracerProvider}; -use opentelemetry::trace::TraceError; +use opentelemetry_api::trace::TraceError; +use opentelemetry_sdk::trace::{BatchSpanProcessor, Tracer}; +use opentelemetry_sdk::{ + self, + trace::{BatchConfig, Config, TracerProvider}, +}; use std::borrow::BorrowMut; use std::sync::Arc; use std::{env, net}; @@ -74,8 +77,8 @@ const DEFAULT_AGENT_ENDPOINT_PORT: &str = "6831"; #[derive(Debug)] pub struct AgentPipeline { transformation_config: TransformationConfig, - trace_config: Option, - batch_config: Option, + trace_config: Option, + batch_config: Option, agent_endpoint: Result, crate::Error>, max_packet_size: usize, auto_split_batch: bool, @@ -235,12 +238,12 @@ impl AgentPipeline { /// /// let pipeline = opentelemetry_jaeger::new_agent_pipeline() /// .with_trace_config( - /// sdk::trace::Config::default() + /// Config::default() /// .with_resource(Resource::new(vec![KeyValue::new("service.name", "my-service")])) /// ); /// /// ``` - pub fn with_trace_config(mut self, config: sdk::trace::Config) -> Self { + pub fn with_trace_config(mut self, config: Config) -> Self { self.set_trace_config(config); self } @@ -253,7 +256,7 @@ impl AgentPipeline { /// # Examples /// Set max queue size. /// ```rust - /// use opentelemetry::sdk::trace::BatchConfig; + /// use opentelemetry::BatchConfig; /// /// let pipeline = opentelemetry_jaeger::new_agent_pipeline() /// .with_batch_processor_config( @@ -270,7 +273,7 @@ impl AgentPipeline { /// /// The exporter will send each span to the agent upon the span ends. pub fn build_simple(mut self) -> Result { - let mut builder = sdk::trace::TracerProvider::builder(); + let mut builder = TracerProvider::builder(); let (config, process) = build_config_and_process( self.trace_config.take(), @@ -304,7 +307,7 @@ impl AgentPipeline { where R: JaegerTraceRuntime, { - let mut builder = sdk::trace::TracerProvider::builder(); + let mut builder = TracerProvider::builder(); let export_instrument_library = self.transformation_config.export_instrument_library; // build sdk trace config and jaeger process. @@ -316,7 +319,7 @@ impl AgentPipeline { let batch_config = self.batch_config.take(); let uploader = self.build_async_agent_uploader(runtime.clone())?; let exporter = Exporter::new(process.into(), export_instrument_library, uploader); - let batch_processor = sdk::trace::BatchSpanProcessor::builder(exporter, runtime) + let batch_processor = BatchSpanProcessor::builder(exporter, runtime) .with_batch_config(batch_config.unwrap_or_default()) .build(); @@ -330,7 +333,7 @@ impl AgentPipeline { /// tracer provider. /// /// The tracer name is `opentelemetry-jaeger`. The tracer version will be the version of this crate. - pub fn install_simple(self) -> Result { + pub fn install_simple(self) -> Result { let tracer_provider = self.build_simple()?; install_tracer_provider_and_get_tracer(tracer_provider) } @@ -339,7 +342,7 @@ impl AgentPipeline { /// tracer provider. /// /// The tracer name is `opentelemetry-jaeger`. The tracer version will be the version of this crate. - pub fn install_batch(self, runtime: R) -> Result + pub fn install_batch(self, runtime: R) -> Result where R: JaegerTraceRuntime, { diff --git a/opentelemetry-jaeger/src/exporter/config/collector/http_client.rs b/opentelemetry-jaeger/src/exporter/config/collector/http_client.rs index c796d57ca6..f55d328133 100644 --- a/opentelemetry-jaeger/src/exporter/config/collector/http_client.rs +++ b/opentelemetry-jaeger/src/exporter/config/collector/http_client.rs @@ -185,8 +185,8 @@ mod collector_client_tests { use crate::config::collector::http_client::test_http_client; use crate::exporter::thrift::jaeger::Batch; use crate::new_collector_pipeline; - use opentelemetry::runtime::Tokio; - use opentelemetry::trace::TraceError; + use opentelemetry_api::trace::TraceError; + use opentelemetry_sdk::runtime::Tokio; #[test] fn test_bring_your_own_client() -> Result<(), TraceError> { diff --git a/opentelemetry-jaeger/src/exporter/config/collector/mod.rs b/opentelemetry-jaeger/src/exporter/config/collector/mod.rs index aa649f58b6..f155ab9edf 100644 --- a/opentelemetry-jaeger/src/exporter/config/collector/mod.rs +++ b/opentelemetry-jaeger/src/exporter/config/collector/mod.rs @@ -5,8 +5,8 @@ use crate::exporter::config::{ use crate::exporter::uploader::{AsyncUploader, Uploader}; use crate::{Exporter, JaegerTraceRuntime}; use http::Uri; -use opentelemetry::sdk::trace::BatchConfig; -use opentelemetry::{sdk, sdk::trace::Config as TraceConfig, trace::TraceError}; +use opentelemetry_api::trace::TraceError; +use opentelemetry_sdk::trace::{BatchConfig, BatchSpanProcessor, Config, Tracer, TracerProvider}; use std::borrow::BorrowMut; use std::convert::TryFrom; use std::env; @@ -91,7 +91,7 @@ const ENV_PASSWORD: &str = "OTEL_EXPORTER_JAEGER_PASSWORD"; #[derive(Debug)] pub struct CollectorPipeline { transformation_config: TransformationConfig, - trace_config: Option, + trace_config: Option, batch_config: Option, #[cfg(feature = "collector_client")] @@ -155,7 +155,7 @@ impl HasRequiredConfig for CollectorPipeline { f(self.transformation_config.borrow_mut()) } - fn set_trace_config(&mut self, config: TraceConfig) { + fn set_trace_config(&mut self, config: Config) { self.trace_config = Some(config) } @@ -400,7 +400,7 @@ impl CollectorPipeline { /// ); /// /// ``` - pub fn with_trace_config(mut self, config: sdk::trace::Config) -> Self { + pub fn with_trace_config(mut self, config: Config) -> Self { self.set_trace_config(config); self } @@ -439,8 +439,8 @@ impl CollectorPipeline { pub fn build_batch( mut self, runtime: R, - ) -> Result { - let mut builder = sdk::trace::TracerProvider::builder(); + ) -> Result { + let mut builder = TracerProvider::builder(); // build sdk trace config and jaeger process. // some attributes like service name has attributes like service name let export_instrument_library = self.transformation_config.export_instrument_library; @@ -451,7 +451,7 @@ impl CollectorPipeline { let batch_config = self.batch_config.take(); let uploader = self.build_uploader::()?; let exporter = Exporter::new(process.into(), export_instrument_library, uploader); - let batch_processor = sdk::trace::BatchSpanProcessor::builder(exporter, runtime) + let batch_processor = BatchSpanProcessor::builder(exporter, runtime) .with_batch_config(batch_config.unwrap_or_default()) .build(); @@ -465,10 +465,7 @@ impl CollectorPipeline { /// tracer provider. /// /// The tracer name is `opentelemetry-jaeger`. The tracer version will be the version of this crate. - pub fn install_batch( - self, - runtime: R, - ) -> Result { + pub fn install_batch(self, runtime: R) -> Result { let tracer_provider = self.build_batch(runtime)?; install_tracer_provider_and_get_tracer(tracer_provider) } @@ -531,7 +528,7 @@ impl CollectorPipeline { mod tests { use super::*; use crate::config::collector::http_client::test_http_client; - use opentelemetry::runtime::Tokio; + use opentelemetry_sdk::runtime::Tokio; #[test] fn test_collector_defaults() { diff --git a/opentelemetry-jaeger/src/exporter/config/mod.rs b/opentelemetry-jaeger/src/exporter/config/mod.rs index 4a782474d9..12df7e6b39 100644 --- a/opentelemetry-jaeger/src/exporter/config/mod.rs +++ b/opentelemetry-jaeger/src/exporter/config/mod.rs @@ -10,8 +10,8 @@ //! [jaeger deployment guide]: https://www.jaegertracing.io/docs/1.31/deployment use crate::Process; -use opentelemetry::trace::{TraceError, TracerProvider}; -use opentelemetry::{global, sdk, KeyValue}; +use opentelemetry_api::{global, trace::TraceError, KeyValue}; +use opentelemetry_sdk::trace::{BatchConfig, Config, Tracer, TracerProvider}; use opentelemetry_semantic_conventions as semcov; /// Config a exporter that sends the spans to a [jaeger agent](https://www.jaegertracing.io/docs/1.31/deployment/#agent). @@ -42,9 +42,9 @@ trait HasRequiredConfig { where T: FnOnce(&mut TransformationConfig); - fn set_trace_config(&mut self, config: sdk::trace::Config); + fn set_trace_config(&mut self, config: Config); - fn set_batch_config(&mut self, config: sdk::trace::BatchConfig); + fn set_batch_config(&mut self, config: BatchConfig); } // To reduce the overhead of copying service name in every spans. We convert resource into jaeger tags @@ -53,9 +53,9 @@ trait HasRequiredConfig { // There are multiple ways to set the service name. A `service.name` tag will be always added // to the process tags. fn build_config_and_process( - config: Option, + config: Option, service_name_opt: Option, -) -> (sdk::trace::Config, Process) { +) -> (Config, Process) { let config = config.unwrap_or_default(); let service_name = service_name_opt.unwrap_or_else(|| { @@ -86,9 +86,8 @@ fn build_config_and_process( mod tests { use crate::exporter::config::build_config_and_process; use crate::new_agent_pipeline; - use opentelemetry::sdk::trace::Config; - use opentelemetry::sdk::Resource; - use opentelemetry::KeyValue; + use opentelemetry_api::KeyValue; + use opentelemetry_sdk::{trace::Config, Resource}; use std::env; #[test] @@ -118,9 +117,10 @@ mod tests { } pub(crate) fn install_tracer_provider_and_get_tracer( - tracer_provider: sdk::trace::TracerProvider, -) -> Result { - let tracer = tracer_provider.versioned_tracer( + tracer_provider: TracerProvider, +) -> Result { + let tracer = opentelemetry_api::trace::TracerProvider::versioned_tracer( + &tracer_provider, "opentelemetry-jaeger", Some(env!("CARGO_PKG_VERSION")), Some(semcov::SCHEMA_URL), diff --git a/opentelemetry-jaeger/src/exporter/mod.rs b/opentelemetry-jaeger/src/exporter/mod.rs index f0feef308c..31af54db9c 100644 --- a/opentelemetry-jaeger/src/exporter/mod.rs +++ b/opentelemetry-jaeger/src/exporter/mod.rs @@ -18,28 +18,30 @@ use std::convert::TryFrom; use self::runtime::JaegerTraceRuntime; use self::thrift::jaeger; +use crate::exporter::uploader::Uploader; use futures_core::future::BoxFuture; +use opentelemetry_api::{ + trace::{Event, Link, SpanKind, Status}, + InstrumentationLibrary, Key, KeyValue, +}; +use opentelemetry_sdk::{ + export::{ + trace::{ExportResult, SpanData, SpanExporter}, + ExportError, + }, + trace::{EvictedHashMap, EvictedQueue}, +}; use std::convert::TryInto; use std::fmt::Display; use std::io; use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, ToSocketAddrs}; use std::sync::Arc; +use std::time::{Duration, SystemTime}; #[cfg(feature = "isahc_collector_client")] #[allow(unused_imports)] // this is actually used to configure authentication use isahc::prelude::Configurable; -use opentelemetry::sdk::export::ExportError; -use opentelemetry::{ - sdk, - sdk::export::trace, - trace::{Event, Link, SpanKind, Status}, - Key, KeyValue, -}; - -use crate::exporter::uploader::Uploader; -use std::time::{Duration, SystemTime}; - /// Instrument Library name MUST be reported in Jaeger Span tags with the following key const INSTRUMENTATION_LIBRARY_NAME: &str = "otel.library.name"; @@ -78,8 +80,8 @@ pub struct Process { pub tags: Vec, } -impl trace::SpanExporter for Exporter { - fn export(&mut self, batch: Vec) -> BoxFuture<'static, trace::ExportResult> { +impl SpanExporter for Exporter { + fn export(&mut self, batch: Vec) -> BoxFuture<'static, ExportResult> { let mut jaeger_spans: Vec = Vec::with_capacity(batch.len()); let process = self.process.clone(); @@ -99,7 +101,7 @@ impl trace::SpanExporter for Exporter { } } -fn links_to_references(links: sdk::trace::EvictedQueue) -> Option> { +fn links_to_references(links: EvictedQueue) -> Option> { if !links.is_empty() { let refs = links .iter() @@ -125,10 +127,7 @@ fn links_to_references(links: sdk::trace::EvictedQueue) -> Option jaeger::Span { +fn convert_otel_span_into_jaeger_span(span: SpanData, export_instrument_lib: bool) -> jaeger::Span { let trace_id_bytes = span.span_context.trace_id().to_bytes(); let (high, low) = trace_id_bytes.split_at(8); let trace_id_high = i64::from_be_bytes(high.try_into().unwrap()); @@ -166,8 +165,8 @@ fn convert_otel_span_into_jaeger_span( } fn build_span_tags( - attrs: sdk::trace::EvictedHashMap, - instrumentation_lib: Option, + attrs: EvictedHashMap, + instrumentation_lib: Option, status: Status, kind: SpanKind, ) -> Vec { @@ -255,7 +254,7 @@ impl UserOverrides { } } -fn events_to_logs(events: sdk::trace::EvictedQueue) -> Option> { +fn events_to_logs(events: EvictedQueue) -> Option> { if events.is_empty() { None } else { @@ -358,9 +357,11 @@ mod tests { use super::SPAN_KIND; use crate::exporter::thrift::jaeger::Tag; use crate::exporter::{build_span_tags, OTEL_STATUS_CODE, OTEL_STATUS_DESCRIPTION}; - use opentelemetry::sdk::trace::EvictedHashMap; - use opentelemetry::trace::{SpanKind, Status}; - use opentelemetry::KeyValue; + use opentelemetry_api::{ + trace::{SpanKind, Status}, + KeyValue, + }; + use opentelemetry_sdk::trace::EvictedHashMap; fn assert_tag_contains(tags: Vec, key: &'static str, expect_val: &'static str) { assert_eq!( diff --git a/opentelemetry-jaeger/src/exporter/runtime.rs b/opentelemetry-jaeger/src/exporter/runtime.rs index 69017ac4aa..df9ed13ea4 100644 --- a/opentelemetry-jaeger/src/exporter/runtime.rs +++ b/opentelemetry-jaeger/src/exporter/runtime.rs @@ -5,7 +5,7 @@ ))] use crate::exporter::addrs_and_family; use async_trait::async_trait; -use opentelemetry::{runtime::RuntimeChannel, sdk::trace::BatchMessage}; +use opentelemetry_sdk::{runtime::RuntimeChannel, trace::BatchMessage}; use std::net::ToSocketAddrs; /// Jaeger Trace Runtime is an extension to [`RuntimeChannel`]. @@ -25,7 +25,7 @@ pub trait JaegerTraceRuntime: RuntimeChannel + std::fmt::Debug { #[cfg(feature = "rt-tokio")] #[async_trait] -impl JaegerTraceRuntime for opentelemetry::runtime::Tokio { +impl JaegerTraceRuntime for opentelemetry_sdk::runtime::Tokio { type Socket = tokio::net::UdpSocket; fn create_socket(&self, endpoint: T) -> thrift::Result { @@ -44,7 +44,7 @@ impl JaegerTraceRuntime for opentelemetry::runtime::Tokio { #[cfg(feature = "rt-tokio-current-thread")] #[async_trait] -impl JaegerTraceRuntime for opentelemetry::runtime::TokioCurrentThread { +impl JaegerTraceRuntime for opentelemetry_sdk::runtime::TokioCurrentThread { type Socket = tokio::net::UdpSocket; fn create_socket(&self, endpoint: T) -> thrift::Result { @@ -63,7 +63,7 @@ impl JaegerTraceRuntime for opentelemetry::runtime::TokioCurrentThread { #[cfg(feature = "rt-async-std")] #[async_trait] -impl JaegerTraceRuntime for opentelemetry::runtime::AsyncStd { +impl JaegerTraceRuntime for opentelemetry_sdk::runtime::AsyncStd { type Socket = async_std::net::UdpSocket; fn create_socket(&self, endpoint: T) -> thrift::Result { diff --git a/opentelemetry-jaeger/src/exporter/thrift/mod.rs b/opentelemetry-jaeger/src/exporter/thrift/mod.rs index 79c83197d6..741752c25b 100644 --- a/opentelemetry-jaeger/src/exporter/thrift/mod.rs +++ b/opentelemetry-jaeger/src/exporter/thrift/mod.rs @@ -1,10 +1,9 @@ //! Thrift generated Jaeger client //! //! Definitions: -use std::time::{Duration, SystemTime}; -use opentelemetry::trace::Event; -use opentelemetry::{Key, KeyValue, Value}; +use opentelemetry_api::{trace::Event, Key, KeyValue, Value}; +use std::time::{Duration, SystemTime}; pub(crate) mod agent; pub(crate) mod jaeger; diff --git a/opentelemetry-jaeger/src/exporter/uploader.rs b/opentelemetry-jaeger/src/exporter/uploader.rs index cef4a24135..ce5a46b79b 100644 --- a/opentelemetry-jaeger/src/exporter/uploader.rs +++ b/opentelemetry-jaeger/src/exporter/uploader.rs @@ -3,8 +3,7 @@ use crate::exporter::collector; use crate::exporter::{agent, jaeger}; use async_trait::async_trait; -use opentelemetry::sdk::export::trace; -use opentelemetry::sdk::export::trace::ExportResult; +use opentelemetry_sdk::export::trace::ExportResult; use std::fmt::Debug; use crate::exporter::thrift::jaeger::Batch; @@ -12,7 +11,7 @@ use crate::exporter::JaegerTraceRuntime; #[async_trait] pub(crate) trait Uploader: Debug + Send + Sync { - async fn upload(&self, batch: jaeger::Batch) -> trace::ExportResult; + async fn upload(&self, batch: jaeger::Batch) -> ExportResult; } #[derive(Debug)] @@ -22,10 +21,10 @@ pub(crate) enum SyncUploader { #[async_trait] impl Uploader for SyncUploader { - async fn upload(&self, batch: jaeger::Batch) -> trace::ExportResult { + async fn upload(&self, batch: jaeger::Batch) -> ExportResult { match self { SyncUploader::Agent(client) => { - // TODO Implement retry behaviour + // TODO Implement retry behavior client .lock() .expect("Failed to lock agent client") diff --git a/opentelemetry-jaeger/src/lib.rs b/opentelemetry-jaeger/src/lib.rs index be60a11b0c..dba81a1fcd 100644 --- a/opentelemetry-jaeger/src/lib.rs +++ b/opentelemetry-jaeger/src/lib.rs @@ -331,7 +331,7 @@ mod exporter; pub mod testing; mod propagator { - use opentelemetry::{ + use opentelemetry_api::{ global::{self, Error}, propagation::{text_map_propagator::FieldIter, Extractor, Injector, TextMapPropagator}, trace::{ @@ -583,7 +583,7 @@ mod propagator { #[cfg(test)] mod tests { use super::*; - use opentelemetry::{ + use opentelemetry_api::{ propagation::{Injector, TextMapPropagator}, testing::trace::TestSpan, trace::{SpanContext, SpanId, TraceContextExt, TraceFlags, TraceId, TraceState}, diff --git a/opentelemetry-jaeger/tests/integration_test.rs b/opentelemetry-jaeger/tests/integration_test.rs index 08c1315dcf..9e742a05f8 100644 --- a/opentelemetry-jaeger/tests/integration_test.rs +++ b/opentelemetry-jaeger/tests/integration_test.rs @@ -1,11 +1,13 @@ #[cfg(feature = "integration_test")] mod tests { - use opentelemetry::sdk::trace::Tracer as SdkTracer; - use opentelemetry::trace::{Status, TraceContextExt, Tracer}; - use opentelemetry::KeyValue; + use opentelemetry_api::{ + trace::{Status, TraceContextExt, Tracer}, + KeyValue, + }; use opentelemetry_jaeger::testing::{ jaeger_api_v2 as jaeger_api, jaeger_client::JaegerTestClient, }; + use opentelemetry_sdk::trace::Tracer as SdkTracer; use std::collections::HashMap; const SERVICE_NAME: &str = "opentelemetry_jaeger_integration_test"; @@ -73,7 +75,7 @@ mod tests { opentelemetry_jaeger::new_agent_pipeline() .with_endpoint(agent_endpoint) .with_service_name(format!("{}-{}", SERVICE_NAME, "agent")) - .install_batch(opentelemetry::runtime::Tokio) + .install_batch(opentelemetry_sdk::runtime::Tokio) .expect("cannot create tracer using default configuration") }), ), @@ -84,7 +86,7 @@ mod tests { .with_endpoint(collector_endpoint) .with_reqwest() .with_service_name(format!("{}-{}", SERVICE_NAME, "collector_reqwest")) - .install_batch(opentelemetry::runtime::Tokio) + .install_batch(opentelemetry_sdk::runtime::Tokio) .expect("cannot create tracer using default configuration") }), ), @@ -95,7 +97,7 @@ mod tests { .with_endpoint(collector_endpoint) .with_isahc() .with_service_name(format!("{}-{}", SERVICE_NAME, "collector_isahc")) - .install_batch(opentelemetry::runtime::Tokio) + .install_batch(opentelemetry_sdk::runtime::Tokio) .expect("cannot create tracer using default configuration") }), ), @@ -106,7 +108,7 @@ mod tests { .with_endpoint(collector_endpoint) .with_surf() .with_service_name(format!("{}-{}", SERVICE_NAME, "collector_surf")) - .install_batch(opentelemetry::runtime::Tokio) + .install_batch(opentelemetry_sdk::runtime::Tokio) .expect("cannot create tracer using default configuration") }), ), @@ -117,7 +119,7 @@ mod tests { .with_endpoint(collector_endpoint) .with_hyper() .with_service_name(format!("{}-{}", SERVICE_NAME, "collector_hyper")) - .install_batch(opentelemetry::runtime::Tokio) + .install_batch(opentelemetry_sdk::runtime::Tokio) .expect("cannot create tracer using default configuration") }), ), diff --git a/opentelemetry-semantic-conventions/Cargo.toml b/opentelemetry-semantic-conventions/Cargo.toml index b3b6c3f84e..e4f26a9d5b 100644 --- a/opentelemetry-semantic-conventions/Cargo.toml +++ b/opentelemetry-semantic-conventions/Cargo.toml @@ -20,7 +20,4 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -opentelemetry = { version = "0.20", default-features = false, path = "../opentelemetry" } - -[dev-dependencies] -opentelemetry = { default-features = false, features = ["trace"], path = "../opentelemetry" } +opentelemetry_api = { version = "0.20", default-features = false, path = "../opentelemetry-api" } \ No newline at end of file diff --git a/opentelemetry-semantic-conventions/src/resource.rs b/opentelemetry-semantic-conventions/src/resource.rs index b1d48b9130..b3f752a088 100644 --- a/opentelemetry-semantic-conventions/src/resource.rs +++ b/opentelemetry-semantic-conventions/src/resource.rs @@ -25,7 +25,7 @@ //! .build(); //! ``` -use opentelemetry::Key; +use opentelemetry_api::Key; /// Array of brand name and version separated by a space. /// @@ -99,7 +99,7 @@ pub const CLOUD_REGION: Key = Key::from_static_str("cloud.region"); /// * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). /// Take care not to use the "invoked ARN" directly but replace any /// [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) -/// with the resolved function version, as the same runtime instance may be invokable with +/// with the resolved function version, as the same runtime instance may be invocable with /// multiple different aliases. /// * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) /// * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) of the invoked function, diff --git a/opentelemetry-semantic-conventions/src/trace.rs b/opentelemetry-semantic-conventions/src/trace.rs index 7935cb6552..58c9d66fad 100644 --- a/opentelemetry-semantic-conventions/src/trace.rs +++ b/opentelemetry-semantic-conventions/src/trace.rs @@ -27,7 +27,7 @@ //! .start(&tracer); //! ``` -use opentelemetry::Key; +use opentelemetry_api::Key; /// Client address - unix domain socket name, IPv4 or IPv6 address. ///