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

[DRAFT - DO NOT MERGE] Basic OpenTelemetry integration #1201

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nshalman
Copy link
Contributor

@nshalman nshalman commented Dec 12, 2024

OpenTelemetry for Dropshot

This is still very much a rough draft, but I want it to be clearly available for anyone interested.

Checklist of things that are needed (note that much of it is currently incomplete):

  • Documentation
  • Tests
  • All desired fields properly traced
  • Examples including how to do propagation

Known Issues

  • If a handler panics, currently we get a 499 error span. I don't really like that.

dtrace.conf(24) References

Slides:
https://docs.google.com/presentation/d/1AW_ugVrmkXDTROgPbEt7bCLrLhFo8-z13PoJAdfPO78/

Raw video link:
https://www.youtube.com/watch?v=KQN1t2qlhaw&t=11760s

Screenshot

image

Comment on lines +89 to +90
#[cfg(feature = "otel-tracing")]
pub span_context: opentelemetry::trace::SpanContext,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gross and I need something better.

Comment on lines +382 to +394
impl std::fmt::Display for HandlerError {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
write!(
f,
"{}",
match self {
Self::Handler { ref message, .. } => message,
Self::Dropshot(ref e) => &e.external_message,
}
)
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is for tokio-tracing and could potentially be dropped or separated into a dedicated commit. Really all the tokio-tracing bits should be a separate commit now that I think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant