opentelemetry_zpages/lib.rs
1//! ZPages implementation for Opentelemetry
2//!
3//! **This crate is deprecated and no longer maintained.**
4//!
5//! # Overview
6//! zPages are an in-process alternative to external exporters. When included,
7//! they collect and aggregate tracing and metrics information in the
8//! background; this data is served on web pages or APIs when requested.
9//!
10//! Currently only tracez components are available. And some of those are still
11//! work in progress. Known limitation includes
12//! - The sampled running span doesn't reflect the changes made to the span.
13//! - The API only returns the json response.
14//! - Users have to build their own http server from the components provided.
15//!
16//! # Get start
17//! The first step is to initiate the [`ZPagesSpanProcessor`] and install it in [`TracerProvider`].
18//!
19//! ```no_run
20//! # use opentelemetry_zpages::tracez;
21//! # use opentelemetry::{global, trace::Tracer};
22//! # use opentelemetry_sdk::{runtime::Tokio, trace::SdkTracerProvider};
23//! # use std::sync::Arc;
24//!
25//! # fn main() {
26//! let (processor, querier) = tracez(5, Tokio);
27//! let provider = SdkTracerProvider::builder()
28//! .with_span_processor(processor)
29//! .build();
30//! global::set_tracer_provider(provider);
31//! # }
32//! ```
33//!
34//! Once the [`ZPagesSpanProcessor`] installed. It will record spans when they
35//! start or end.
36//!
37//! Users can then use the [`TracezQuerier`] to query the aggregated span information.
38//!
39//! A detailed example can also be founded [here].
40//!
41//!
42//! [`ZPagesSpanProcessor`]: trace::span_processor::ZPagesSpanProcessor
43//! [`TracerProvider`]: opentelemetry_sdk::trace::SdkTracerProvider
44//! [here]: https://github.com/open-telemetry/opentelemetry-rust/tree/main/examples/zpages
45#![warn(
46 future_incompatible,
47 missing_debug_implementations,
48 missing_docs,
49 nonstandard_style,
50 rust_2018_idioms,
51 unreachable_pub,
52 unused
53)]
54#![allow(elided_lifetimes_in_paths)]
55#![cfg_attr(
56 docsrs,
57 feature(doc_cfg, doc_auto_cfg),
58 deny(rustdoc::broken_intra_doc_links)
59)]
60#![doc(
61 html_logo_url = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-rust/master/assets/logo.svg"
62)]
63#![allow(deprecated)]
64
65use trace::span_queue::SpanQueue;
66
67mod trace;
68
69pub use trace::{
70 span_processor::ZPagesSpanProcessor, tracez, TracezError, TracezQuerier, TracezResponse,
71};