Skip to content
Prev Previous commit
Next Next commit
Fix indentation
  • Loading branch information
emschwartz committed Jun 9, 2023
commit b4ec313e38b96a9bd315504569536dfb45303a83
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,26 @@ https://github.com/autometrics-dev/autometrics-rs/assets/3262610/966ed140-1d6c-4
```
2. Instrument your functions with the [`#[autometrics]`](https://docs.rs/autometrics/latest/autometrics/attr.autometrics.html) macro

```rust
use autometrics::autometrics;

#[autometrics]
pub async fn my_function() {
// Now this function produces metrics!
}

struct MyStruct;
```rust
use autometrics::autometrics;

// Just add the autometrics annotation to your functions
#[autometrics]
pub async fn my_function() {
// Now this function produces metrics!
}

struct MyStruct;

// You can also instrument whole impl blocks
#[autometrics]
impl MyStruct {
pub fn my_method() {
// This method produces metrics too!
}
}
```

#[autometrics]
impl MyStruct {
pub fn my_method() {
// This method produces metrics too!
}
}
```

<details>

Expand Down