diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-08-29 16:53:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-29 16:53:23 -0500 |
| commit | 3b84bc0fb84069491aa6a801c710b3c264563a97 (patch) | |
| tree | c18afa5445065a99e4a5c1d990189e5f39a88dfb /docs | |
| parent | 0085fa79cbe0b2589abc9ca6a99c367ff5ff0fd5 (diff) | |
| parent | d7520caa80629ea0821d936ebf2f236e14f89abe (diff) | |
| download | slskd-3b84bc0fb84069491aa6a801c710b3c264563a97.tar.gz | |
Merge pull request #619 from slskd/metrics-auth
Refactor Prometheus implementation and add basic authentication for the /metrics endpoint
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/config.md | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/docs/config.md b/docs/config.md index 8403b76f..4e1f18dc 100644 --- a/docs/config.md +++ b/docs/config.md @@ -666,23 +666,48 @@ logger: loki: ~ ``` +## Metrics + +The application captures metrics internally and can optionally expose these metrics to be consumed by an instance of Prometheus. This is a good option for those wanting to tune performance characterisics of the application. + +Metrics are disabled by default, and enabling them will make them available at `/metrics`. Authentication is enabled by default, and the credentials are the same defaults as the web UI (`slskd`:`slskd`). + +If the application will be exposed to the internet, it's a good idea to leave this disabled or to set credentials other than the defaults. Elements of the system configuration, like operating system, architecture, and drive configuration are included and can this can make it easier for an attacker to exploit a vulnerability in your system. + + +| Command Line | Environment Variable | Description | +| -------------------- | -------------------- | --------------------------------------------------------- | +| `--metrics` | `METRICS` | Determines whether the metrics endpoint should be enabled | +| `--metrics-url` | `METRICS_URL` | The URL of the metrics endpoint | +| `--metrics-no-auth` | `METRICS_NO_AUTH` | Disables authentication for the metrics endpoint | +| `--metrics-username` | `METRICS_USERNAME` | The username for the metrics endpoint | +| `--metrics-password` | `METRICS_PASSWORD` | The password for the metrics endpoint | + +#### **YAML** + +```yaml +metrics: + enabled: false + url: /metrics + authentication: + disabled: false + username: slskd + password: slskd +``` + ## Features Several features have been added that aid in the development, debugging and operation of the application, but are generally not of much use to most users. -The application can publish Prometheus metrics to `/metrics` using [prometheus-net](https://github.com/prometheus-net/prometheus-net). This is especially useful for anyone attempting to tune performance characteristics. - The application can publish a Swagger (OpenAPI) definition and host SwaggerUI at `/swagger` using [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore). This is useful for anyone developing against the application API and/or creating a new web interface. | Command Line | Environment Variable | Description | | -------------- | -------------------- | ----------------------------------------------------------------------------------------- | -| `--prometheus` | `PROMETHEUS` | Determines whether Prometheus metrics are published to `/metrics` | | `--swagger` | `SWAGGER` | Determines whether Swagger (OpenAPI) definitions and UI should be available at `/swagger` | #### **YAML** ```yaml feature: - prometheus: false swagger: false ``` |
