diff --git a/opentelemetry-otlp/src/lib.rs b/opentelemetry-otlp/src/lib.rs index 7e4c2d04ae..76e3493dab 100644 --- a/opentelemetry-otlp/src/lib.rs +++ b/opentelemetry-otlp/src/lib.rs @@ -24,23 +24,25 @@ //! Then install a new pipeline with the recommended defaults to start exporting //! telemetry. You will have to build a OTLP exporter first. //! -//! Tracing and metrics pipelines can be started with `new_pipeline().tracing()` and -//! `new_pipeline().metrics()` respectively. +//! Exporting pipelines can be started with `new_pipeline().tracing()` and +//! `new_pipeline().metrics()`, and `new_pipeline().logging()` respectively for +//! traces, metrics and logs. //! //! ```no_run //! # #[cfg(all(feature = "trace", feature = "grpc-tonic"))] //! # { +//! use opentelemetry::global; //! use opentelemetry::trace::Tracer; //! //! fn main() -> Result<(), Box> { //! // First, create a OTLP exporter builder. Configure it as you need. //! let otlp_exporter = opentelemetry_otlp::new_exporter().tonic(); //! // Then pass it into pipeline builder -//! let tracer = opentelemetry_otlp::new_pipeline() +//! let _ = opentelemetry_otlp::new_pipeline() //! .tracing() //! .with_exporter(otlp_exporter) //! .install_simple()?; -//! +//! let tracer = global::tracer("my_tracer"); //! tracer.in_span("doing_work", |cx| { //! // Traced app logic here... //! }); diff --git a/opentelemetry-otlp/tests/integration_test/Cargo.toml b/opentelemetry-otlp/tests/integration_test/Cargo.toml index b277af6143..b21861d19d 100644 --- a/opentelemetry-otlp/tests/integration_test/Cargo.toml +++ b/opentelemetry-otlp/tests/integration_test/Cargo.toml @@ -15,3 +15,4 @@ opentelemetry-proto = { path = "../../../opentelemetry-proto", features = ["gen- tokio = { version = "1.0", features = ["full"] } serde_json = "1" testcontainers = "0.15.0" +# env_logger = "0.11.3" // uncomment if needed for local debugging. diff --git a/opentelemetry-otlp/tests/integration_test/tests/integration_tests.rs b/opentelemetry-otlp/tests/integration_test/tests/integration_tests.rs index 0e73d7f040..a2d4e5b7ab 100644 --- a/opentelemetry-otlp/tests/integration_test/tests/integration_tests.rs +++ b/opentelemetry-otlp/tests/integration_test/tests/integration_tests.rs @@ -52,6 +52,11 @@ impl TestSuite { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[ignore] // skip when running unit test async fn integration_tests() { + // Uncomment to see logs from testcontainers + // env_logger::init(); + // Run locally using the below command + // cargo test -- --ignored --nocapture + let test_suites = [TestSuite::new("traces.json")]; let mut collector_image = Collector::default();