Skip to content

Commit

Permalink
Document sonar and proivde a dashboard (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvolp12 authored Sep 23, 2024
2 parents 5c2cb48 + 415b092 commit 01a47d4
Show file tree
Hide file tree
Showing 4 changed files with 1,581 additions and 12 deletions.
24 changes: 24 additions & 0 deletions cmd/sonar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Sonar
Sonar is an AT Proto Firehose Montioring tool

This comment has been minimized.

Copy link
@mackuba

mackuba Sep 26, 2024

^ typo


Sonar connects to an AT Proto Firehose (either from a PDS or a Relay) following the semantics of `com.atproto.sync.subscribeRepos`.

Sonar monitors the throughput of events, producing prometheus metrics on the frequency of different kinds of events.

Sonar additionally walks through repo operations and tracks the frequency of creation/update/deletion of different record collections.

Sonar's main use is to provide an operational dashboard of activity on the network, allowing us to view changes in event rate over time and understand what kinds of traffic flow through the firehose over time.

## Running Sonar

To run sonar in Docker locally, you can run: `make sonar-up` from the root of the `indigo` directory.

This will start a sonar instance that connects to the Bluesky-operated Relay firehose at `bsky.network` and will expose metrics at `http://localhost:8345`

Feel free to modify the `docker-compose.yml` in this directory to change any settings via environment variables i.e. to change the firehose host `SONAR_WS_URL` or the listen port `SONAR_PORT`.

## Dashboard

Sonar emits Prometheus metrics which you can scrape and then visualize with the Grafana dashboard (JSON template provided in this directory) shown below:

![A dashboard for Sonar showing event throughput and distribution](./sonar_dash.png)
Loading

0 comments on commit 01a47d4

Please # to comment.