blob: 6c1cddd61dee4c37ef1b7ea710f025639961a597 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# Metrics
GoToSocial comes with [OpenTelemetry][otel] based metrics built-in with pull-style Prometheus exporter. Currently the following metrics are collected:
* Go performance and runtime metrics
* Gin (HTTP) metrics
* Bun (database) metrics
How to configure metrics is explained in the [Observability configuration reference][obs].
For a quickstart, add the following to your GoToSocial configuration and restart your instance:
```yaml
metrics-enabled: true
metrics-auth-enabled: true
metrics-auth-username: some_username
metrics-auth-password: some_password
```
This will expose the metrics under the endpoint `/metrics`, protected with HTTP Basic Authentication.
A following is an example how to configure a job for collecting the metrics in Prometheus `scrape_configs`:
```yaml
- job_name: gotosocial
metrics_path: /metrics
scheme: https
basic_auth:
username: some_username
password: some_password
static_configs:
- targets:
- example.org
```
[otel]: https://opentelemetry.io/
[obs]: ../configuration/observability.md
|