Skip to content

Commit

Permalink
Merge pull request #156 from emit-rs/docs/screenshots
Browse files Browse the repository at this point in the history
Add examples of metric and trace data in zipkin and prometheus
  • Loading branch information
KodrAus authored Oct 21, 2024
2 parents dc9785c + 99e5898 commit 7c95b01
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Developer-first diagnostics for Rust applications

`emit` is a framework for adding diagnostics to your Rust applications with a simple, powerful data model and an expressive syntax inspired by [Message Templates](https://messagetemplates.org). `emit`'s guiding design principle is low ceremony, low cognitive-load.
`emit` is a framework for adding structured diagnostics to your Rust applications with a simple, powerful data model and an expressive syntax inspired by [Message Templates](https://messagetemplates.org). `emit`'s guiding design principle is low ceremony, low cognitive-load.

This readme covers just enough to give you an idea of what `emit` is. For a proper treatment, see:

Expand Down Expand Up @@ -52,3 +52,19 @@ fn greet(user: &str) {
```

![The output of running the above program](https://github.com/emit-rs/emit/blob/main/asset/emit_term.png?raw=true)

## Tracing

`emit` can also produce trace data that's compatible with standard tracing tools, like Zipkin.

![An example trace produced by `emit` in Zipkin](https://github.com/emit-rs/emit/blob/main/asset/trace-zipkin.png?raw=true)

See [the guide](https://emit-rs.io/producing-events/tracing.html) for details.

## Metrics

`emit` can also produce metric data that's compatible with standard metric tools, like Prometheus.

![An example metric produced by `emit` in Prometheus](https://github.com/emit-rs/emit/blob/main/asset/metric-prometheus.png?raw=true)

See [the guide](https://emit-rs.io/producing-events/metrics.html) for details.
Binary file added asset/metric-prometheus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asset/trace-zipkin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/src/asset/metric-prometheus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/src/asset/trace-zipkin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions book/src/producing-events/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ Event {
- [`error!`](https://docs.rs/emit/0.11.0-alpha.21/emit/macro.error.html) for errors that caused the calling operation to fail.

See [Levels](./logging/levels.md) for details.

-----

![an example log rendered to the console](../asset/term-err.png)

_An example log produced by `emit` rendered to the console_
2 changes: 2 additions & 0 deletions book/src/producing-events/logging/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ Event {
```

See [Template syntax and rendering](../../reference/templates.md) for more details.

Properties aren't limited to strings; they can be arbitrarily complex structured values. See [Value data model](../../reference/events.md#value-data-model) for more details.
6 changes: 6 additions & 0 deletions book/src/producing-events/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ Event {
},
}
```

-----

![an example metric in Prometheus](../asset/metric-prometheus.png)

_An example metric produced by `emit` in Prometheus_
6 changes: 6 additions & 0 deletions book/src/producing-events/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ wait_a_bit(1200).await;
- [`#[error_span]`](https://docs.rs/emit/0.11.0-alpha.21/emit/attr.error_span.html)

The level of a span may also depend on its execution. See [Fallible functions](./tracing/fallible-functions.md) and [Manual span completion](./tracing/manual-span-completion.md) for details.

-----

![an example trace in Zipkin](../asset/trace-zipkin.png)

_An example trace produced by `emit` in Zipkin_

0 comments on commit 7c95b01

Please sign in to comment.