Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Lok <[email protected]>
  • Loading branch information
andylokandy committed Jan 26, 2024
1 parent f4f8254 commit 4ac4b90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Libraries should include `minitrace` as a dependency without enabling any extra
minitrace = "0.6"
```

Add a `trace` attribute to the function you want to trace. In this example, a `SpanRecord` will be collected everytime the function is alled, if a tracing context is set up by the caller.
Add a `trace` attribute to the function you want to trace. In this example, a `SpanRecord` will be collected every time the function is called, if a tracing context is set up by the caller.

```rust
#[minitrace::trace]
Expand All @@ -51,7 +51,7 @@ pub fn send_request(req: HttpRequest) -> Result<(), Error> {

Libraries are able to set up an individual tracing context, regardless of whether the caller has set up a tracing context or not. This can be achieved by using `Span::root()` to start a new trace and `Span::set_local_parent()` to set up a local context for the current thread.

The `full_name!()` macro can auto detect the function's full name, which is usedas the name of the root span.
The `full_name!()` macro can detect the function's full name, which is used as the name of the root span.

```rust
use minitrace::prelude::*;
Expand Down
8 changes: 4 additions & 4 deletions minitrace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
//! ```
//!
//! Add a [`trace`] attribute to the function you want to trace. In this example, a
//! [`SpanRecord`] will be collected everytime the function is called, if a tracing context is
//! set up by the caller.
//! [`SpanRecord`] will be collected every time the function is called, if a tracing context
//! is set up by the caller.
//!
//! ```
//! # struct HttpRequest;
Expand All @@ -38,8 +38,8 @@
//! [`Span::root()`] to start a new trace and [`Span::set_local_parent()`] to set up a
//! local context for the current thread.
//!
//! The [`full_name!()`] macro can auto detect the function's full name, which is used
//! as the name of the root span.
//! The [`full_name!()`] macro can detect the function's full name, which is used as
//! the name of the root span.
//!
//! ```
//! use minitrace::prelude::*;
Expand Down

0 comments on commit 4ac4b90

Please sign in to comment.