1
0
mirror of https://github.com/actix/examples synced 2024-12-02 18:02:22 +01:00
examples/tracing/mainmatter-workshop
2024-09-11 16:05:47 -04:00
..
src chore: remove unused deps 2024-09-11 16:05:47 -04:00
.env.example feat: add mainmatter telemetry workshop example 2024-06-05 04:52:05 +01:00
.gitignore feat: add mainmatter telemetry workshop example 2024-06-05 04:52:05 +01:00
Cargo.toml chore: remove unused deps 2024-09-11 16:05:47 -04:00
README.md fix: add metric labels 2024-06-05 04:54:40 +01:00

Telemetry Workshop Solution

Overview

A solution to the capstone project at the end of Mainmatter's telemetry workshop.

As stated in the exercise brief, this example will:

  • Configure a tracing subscriber that exports data to both Honeycomb and stdout, in JSON format;
  • Configure a suitable panic hook;
  • Configure a metric recorder that exposes metric data at /metrics, using a different port than your API endpoints (this example shows how to use the existing HTTP server);
  • Add one or more middleware that:
    • Create a top-level INFO span for each incoming request;
    • Track the number of concurrent requests using a gauge;
    • Track request duration using a histogram;
    • Track the number of handled requests
  • All metrics should include success/failure as a label.

Usage

$ cd tracing/mainmatter-workshop
$ cargo run