Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ github-scout shows you what is waiting for you across all your repositories, in

## Who it is for

github-scout is built for people with many GitHub repositories, private ones included, who already run Grafana and Loki. It checks each repository every 15 minutes. It covers up to 500 repositories of your own github.com account, not organization repositories or Dependabot alerts.
github-scout is built for people with many GitHub repositories, private ones included. It checks each repository every 15 minutes. It covers up to 500 repositories of your own github.com account, not organization repositories or Dependabot alerts.

You need Grafana, Loki, a log collector such as Grafana Alloy, and a read-only GitHub personal access token.
github-scout reports through its log, so its dashboard and alerts come from your Grafana, Loki and Alertmanager, which the [monitoring guide](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#the-smallest-stack-sends-notifications-only) sets up. You also need a read-only GitHub personal access token.

Other tools suit other needs:

Expand Down Expand Up @@ -60,8 +60,8 @@ services:
```

4. Run `docker compose up -d`.
5. Have your log collector send the container's logs to Loki with the label `container="github-scout"`, which every dashboard panel selects on.
6. In Grafana, import [`grafana-dashboard.json`](grafana-dashboard.json). It reads from your default Loki data source.
5. Have your log collector [send the container's logs to Loki](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#the-smallest-stack-sends-notifications-only) with the label `container="github-scout"`, which every dashboard panel selects on.
6. In Grafana, [import](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#importing-an-apps-dashboard) [`grafana-dashboard.json`](grafana-dashboard.json). It reads from your default Loki data source.

Run `docker logs github-scout`. You should see a line with `"msg":"scan complete"`. If you see `"msg":"repo discovery failed"` instead, GitHub rejected the token or could not be reached. Check the `GITHUB_TOKEN` line of `.env`.

Expand Down Expand Up @@ -101,7 +101,7 @@ The healthcheck runs `/github-scout health`, which checks that the scan loop ref

## Monitoring

github-scout writes one JSON log line for each open pull request, issue, alert and finished run, plus a `scan complete` summary after each scan. The bundled dashboard reads those lines from Loki, and two Loki alert rules fire when scans go blind or stop. [Monitoring and alerts](docs/monitoring.md) lists the log fields, the dashboard and the rules.
github-scout writes one JSON log line for each open pull request, issue, alert and finished run, plus a `scan complete` summary after each scan. Two Loki alert rules fire when scans go blind or stop. [Monitoring and alerts](docs/monitoring.md) lists the log fields, the dashboard and the rules.

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/hardening.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Because github-scout only reads, a read-only token is all it needs. [Configurati

## Hardened deployment

To lock the container down further, pin the image by digest and add these settings to the quick start service:
[Pin the image by digest](https://github.com/cplieger/docs/blob/main/docs/images.md#pinning-a-digest) and add these lines to the quick start service. [Hardening a compose file](https://github.com/cplieger/docs/blob/main/docs/hardening.md) explains each setting.

```yaml
read_only: true
Expand Down
4 changes: 2 additions & 2 deletions docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ A single 401 beside successful reads only marks the scan degraded, because GitHu

## Grafana dashboard

Ship the container's logs to Loki with a `container` label that holds the container name, then import [`grafana-dashboard.json`](../grafana-dashboard.json) or drop it into a file-based dashboard provider. With Grafana Alloy's [`loki.source.docker`](https://grafana.com/docs/alloy/latest/reference/components/loki/loki.source.docker/), that label comes from a relabel rule that copies `__meta_docker_container_name` without its leading `/`. The dashboard reads from your default Loki data source and needs no plugin. Its rows follow the order you ask questions:
The dashboard needs the container's log in Loki with a `container` label that holds the container name, which the Alloy config in the [monitoring guide](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#the-smallest-stack-sends-notifications-only) sets. [Importing an app's dashboard](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#importing-an-apps-dashboard) shows how to load [`grafana-dashboard.json`](../grafana-dashboard.json). The dashboard reads from your default Loki data source and needs no plugin. Its rows follow the order you ask questions:

1. At a glance holds four count tiles, for open pull requests, open issues, code-scanning alerts and failed CI runs in the selected time range.
2. Open work holds linked tables of the open pull requests, issues and code-scanning alerts from the latest scan.
Expand Down Expand Up @@ -104,7 +104,7 @@ spec:

## Alerting

github-scout has no metrics endpoint, so its state is in its logs. Ship the container's logs to Loki as above and evaluate these rules with [Loki's ruler](https://grafana.com/docs/loki/latest/alert/). Firing alerts go through your Alertmanager like any Prometheus alert. The first rule catches scans that ran but went blind. The second fires when no scan completes at all.
github-scout has no metrics endpoint, so its state is in its logs. These rules are for Loki's ruler. Save the block below as a file in Loki's rules folder, as [Loading an app's alert rules](https://github.com/cplieger/docs/blob/main/docs/monitoring.md#loading-an-apps-alert-rules) shows. The first rule catches scans that ran but went blind. The second fires when no scan completes at all.

```yaml
groups:
Expand Down
Loading