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

Add warning about assigning the uninstaller to '_' #372

Merged
merged 3 commits into from Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -37,6 +37,9 @@ use opentelemetry::{exporter::trace::stdout, trace::Tracer};

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// Create a new instrumentation pipeline
// Note: uninstalling the tracer happens when the _uninstall
// variable is dropped. Assigning it to _ will immediately
// drop it and uninstall the tracer
let (tracer, _uninstall) = stdout::new_pipeline().install();

tracer.in_span("doing_work", |cx| {
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-contrib/src/trace/exporter/datadog/mod.rs
Expand Up @@ -290,5 +290,6 @@ impl trace::SpanExporter for DatadogExporter {
}

/// Uninstalls the Datadog pipeline on drop
#[must_use]
#[derive(Debug)]
pub struct Uninstall(global::TracerProviderGuard);
1 change: 1 addition & 0 deletions opentelemetry-jaeger/src/lib.rs
Expand Up @@ -225,6 +225,7 @@ pub fn new_pipeline() -> PipelineBuilder {
}

/// Guard that uninstalls the Jaeger trace pipeline when dropped
#[must_use]
#[derive(Debug)]
pub struct Uninstall(global::TracerProviderGuard);

Expand Down
1 change: 1 addition & 0 deletions opentelemetry-otlp/src/lib.rs
Expand Up @@ -233,5 +233,6 @@ impl OtlpPipelineBuilder {
}

/// Uninstalls the OTLP pipeline on drop
#[must_use]
#[derive(Debug)]
pub struct Uninstall(global::TracerProviderGuard);
1 change: 1 addition & 0 deletions opentelemetry-zipkin/src/lib.rs
Expand Up @@ -320,5 +320,6 @@ impl trace::SpanExporter for Exporter {
}

/// Uninstalls the Zipkin pipeline on drop.
#[must_use]
#[derive(Debug)]
pub struct Uninstall(global::TracerProviderGuard);
1 change: 1 addition & 0 deletions opentelemetry/src/exporter/trace/stdout.rs
Expand Up @@ -141,5 +141,6 @@ where
}

/// Uninstalls the stdout pipeline on drop.
#[must_use]
#[derive(Debug)]
pub struct Uninstall(global::TracerProviderGuard);