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

feat: ignore links with invalid context #538

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion opentelemetry-datadog/README.md
Expand Up @@ -82,7 +82,7 @@ to [`Datadog`].
// Traced app logic here...
});

opentelemetry::global::shut_down_provider();
opentelemetry::global::shutdown_tracer_provider();

Ok(())
}
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-jaeger/README.md
Expand Up @@ -53,7 +53,7 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// Traced app logic here...
});

global::shut_down_provider(); // sending remaining spans
global::shutdown_tracer_provider(); // sending remaining spans

Ok(())
}
Expand Down Expand Up @@ -131,7 +131,7 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// Traced app logic here...
});

opentelemetry::global::shut_down_provider(); // sending remaining spans
opentelemetry::global::shutdown_tracer_provider(); // sending remaining spans

Ok(())
}
Expand Down Expand Up @@ -175,7 +175,7 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// Traced app logic here...
});

global::shut_down_provider(); // sending remaining spans
global::shutdown_tracer_provider(); // sending remaining spans

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-zipkin/README.md
Expand Up @@ -53,7 +53,7 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
// Traced app logic here...
});

global::shut_down_provider();
global::shutdown_tracer_provider();

Ok(())
}
Expand Down Expand Up @@ -153,7 +153,7 @@ fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
// Traced app logic here...
});

global::shut_down_provider();
global::shutdown_tracer_provider();

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry/src/sdk/trace/span.rs
Expand Up @@ -523,8 +523,8 @@ mod tests {

let mut link = Link::new(
SpanContext::new(
TraceId::from_u128(0),
SpanId::from_u64(0),
TraceId::from_u128(12),
SpanId::from_u64(12),
0,
false,
Default::default(),
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry/src/trace/tracer.rs
Expand Up @@ -458,7 +458,8 @@ impl SpanBuilder {
}

/// Assign links
pub fn with_links(self, links: Vec<Link>) -> Self {
pub fn with_links(self, mut links: Vec<Link>) -> Self {
links.retain(|l| l.span_context().is_valid());
SpanBuilder {
links: Some(links),
..self
Expand Down