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 SpanExporter::ForceFlush and default implementation #845

Merged
Merged
Changes from all 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
19 changes: 19 additions & 0 deletions opentelemetry-sdk/src/export/trace/mod.rs
Expand Up @@ -45,6 +45,25 @@ pub trait SpanExporter: Send + Debug {
/// can decide if they want to make the shutdown timeout
/// configurable.
fn shutdown(&mut self) {}

/// This is a hint to ensure that the export of any Spans the exporter
/// has received prior to the call to this function SHOULD be completed
/// as soon as possible, preferably before returning from this method.
///
/// This function SHOULD provide a way to let the caller know
/// whether it succeeded, failed or timed out.
///
/// This function SHOULD only be called in cases where it is absolutely necessary,
/// such as when using some FaaS providers that may suspend the process after
/// an invocation, but before the exporter exports the completed spans.
///
/// This function SHOULD complete or abort within some timeout. This function can be
/// implemented as a blocking API or an asynchronous API which notifies the caller via
/// a callback or an event. OpenTelemetry client authors can decide if they want to
/// make the flush timeout configurable.
fn force_flush(&mut self) -> BoxFuture<'static, ExportResult> {
Box::pin(async { Ok(()) })
}
}

/// `SpanData` contains all the information collected by a `Span` and can be used
Expand Down