Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 0 additions & 90 deletions tracing-actix-web/.github/workflows/general.yml

This file was deleted.

3 changes: 0 additions & 3 deletions tracing-actix-web/.gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions tracing-actix-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

## Unreleased

## 0.7.21

- The repository has been moved under the [actix](https://github.com/actix/actix-extras) organization. The future development will happen there.

## 0.7.20

- Support Opentelemetry 0.31
2 changes: 1 addition & 1 deletion tracing-actix-web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tracing-actix-web"
version = "0.7.19"
version = "0.7.21"
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: v0.7.20 was out while moving is ongoing: https://github.com/LukeMathWalker/tracing-actix-web/releases/tag/v0.7.20

authors = ["Luca Palmieri <[email protected]>"]
documentation = "https://docs.rs/tracing-actix-web/"
readme = "README.md"
Expand Down
16 changes: 8 additions & 8 deletions tracing-actix-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() {
}
```

Check out [the examples on GitHub](https://github.com/actix/tracing-actix-web/tree/main/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your
Check out [the examples on GitHub](https://github.com/actix/actix-extras/tree/main/tracing-actix-web/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your
application.

# From zero to hero: a crash course in observability
Expand All @@ -112,24 +112,24 @@ All the spans created _while_ processing the request will be children of the roo
Those properties can then be queried in a variety of tools (e.g. ElasticSearch, Honeycomb, DataDog) to
understand what is happening in your system.

## Customisation via [`RootSpanBuilder`]
## Customization via [`RootSpanBuilder`]

Troubleshooting becomes much easier when the root span has a _rich context_ - e.g. you can understand most of what
happened when processing the request just by looking at the properties attached to the corresponding root span.

You might have heard of this technique as the [canonical log line pattern](https://stripe.com/blog/canonical-log-lines),
popularised by Stripe. It is more recently discussed in terms of [high-cardinality events](https://www.honeycomb.io/blog/observability-a-manifesto/)
popularized by Stripe. It is more recently discussed in terms of [high-cardinality events](https://www.honeycomb.io/blog/observability-a-manifesto/)
by Honeycomb and other vendors in the observability space.

[`TracingLogger`] gives you a chance to use the very same pattern: you can customise the properties attached
[`TracingLogger`] gives you a chance to use the very same pattern: you can customize the properties attached
to the root span in order to capture the context relevant to your specific domain.

[`TracingLogger::default`] is equivalent to:

```rust
use tracing_actix_web::{TracingLogger, DefaultRootSpanBuilder};

// Two ways to initialise TracingLogger with the default root span builder
// Two ways to initialize TracingLogger with the default root span builder
let default = TracingLogger::default();
let another_way = TracingLogger::<DefaultRootSpanBuilder>::new();
```
Expand All @@ -138,7 +138,7 @@ We are delegating the construction of the root span to [`DefaultRootSpanBuilder`
[`DefaultRootSpanBuilder`] captures, out of the box, several dimensions that are usually relevant when looking at an HTTP
API: method, version, route, etc. - check out its documentation for an extensive list.

You can customise the root span by providing your own implementation of the [`RootSpanBuilder`] trait.
You can customize the root span by providing your own implementation of the [`RootSpanBuilder`] trait.
Let's imagine, for example, that our system cares about a client identifier embedded inside an authorization header.
We could add a `client_id` property to the root span using a custom builder, `DomainRootSpanBuilder`:

Expand Down Expand Up @@ -199,7 +199,7 @@ We need to use a macro because `tracing` requires all the properties attached to
You cannot add new ones afterwards. This makes it extremely fast, but it pushes us to reach for macros when we need some level of
composition.

[`root_span!`] exposes more or less the same knob you can find on `tracing`'s `span!` macro. You can, for example, customise
[`root_span!`] exposes more or less the same knob you can find on `tracing`'s `span!` macro. You can, for example, customize
the span level:

```rust
Expand Down Expand Up @@ -313,7 +313,7 @@ You can then find all logs for the same request across all the services it touch
If you add [`tracing-opentelemetry::OpenTelemetryLayer`](https://docs.rs/tracing-opentelemetry/0.17.0/tracing_opentelemetry/struct.OpenTelemetryLayer.html)
in your `tracing::Subscriber` you will be able to export the root span (and all its children) as OpenTelemetry spans.

Check out the [relevant example in the GitHub repository](https://github.com/actix/tracing-actix-web/tree/main/examples/opentelemetry) for reference.
Check out the [relevant example in the GitHub repository](https://github.com/actix/actix-extras/tree/main/tracing-actix-web/examples/opentelemetry) for reference.

# License

Expand Down
4 changes: 2 additions & 2 deletions tracing-actix-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
//! // Mount `TracingLogger` as a middleware
//! .wrap(TracingLogger::default())
//! .service( /* */ )
//! });

Check failure on line 55 in tracing-actix-web/src/lib.rs

View workflow job for this annotation

GitHub Actions / Documentation Tests

this method takes 1 argument but 0 arguments were supplied

Check failure on line 55 in tracing-actix-web/src/lib.rs

View workflow job for this annotation

GitHub Actions / Documentation Tests

this method takes 1 argument but 0 arguments were supplied
//! ```
//!
//! Check out [the examples on GitHub](https://github.com/actix/tracing-actix-web/tree/main/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your
//! Check out [the examples on GitHub](https://github.com/actix/actix-extras/tree/main/tracing-actix-web/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your
//! application.
//!
//! # From zero to hero: a crash course in observability
Expand Down Expand Up @@ -282,7 +282,7 @@
//! If you add [`tracing-opentelemetry::OpenTelemetryLayer`](https://docs.rs/tracing-opentelemetry/0.17.0/tracing_opentelemetry/struct.OpenTelemetryLayer.html)
//! in your `tracing::Subscriber` you will be able to export the root span (and all its children) as OpenTelemetry spans.
//!
//! Check out the [relevant example in the GitHub repository](https://github.com/actix/tracing-actix-web/tree/main/examples/opentelemetry) for reference.
//! Check out the [relevant example in the GitHub repository](https://github.com/actix/actix-extras/tree/main/tracing-actix-web/examples/opentelemetry) for reference.
//!
//! [root span]: crate::RootSpan
//! [`actix-web`]: https://docs.rs/actix-web/4.0.0-beta.13/actix_web/index.html
Expand Down