diff options
| author | 2025-10-13 18:22:28 +0200 | |
|---|---|---|
| committer | 2025-10-17 15:33:07 +0200 | |
| commit | c9fcf3f11cac21cc326fd20a34cae3d629aad0c3 (patch) | |
| tree | b4d7e2a122ae7dc03ef76152b63320ab05580cb4 /docs/advanced | |
| parent | [bugfix] Fix "client IP could not be parsed" error msg (#4497) (diff) | |
| download | gotosocial-c9fcf3f11cac21cc326fd20a34cae3d629aad0c3.tar.xz | |
[docs] Document setting `OTEL_EXPORTER_PROMETHEUS_HOST` for Docker (#4498)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4493
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4498
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'docs/advanced')
| -rw-r--r-- | docs/advanced/metrics.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/advanced/metrics.md b/docs/advanced/metrics.md index 91e94b4d2..801c113e1 100644 --- a/docs/advanced/metrics.md +++ b/docs/advanced/metrics.md @@ -37,8 +37,12 @@ OTEL_EXPORTER_PROMETHEUS_PORT=9999 ## Serving metrics to the outside world +### Bare metal, no reverse proxy + If you have deployed GoToSocial in a "bare-metal" fashion without a reverse proxy, you can expose the metrics endpoint to the outside world by setting `OTEL_EXPORTER_PROMETHEUS_HOST` to your host value. For example, if your GtS instance `host` configuration value is set to `example.org`, you should set `OTEL_EXPORTER_PROMETHEUS_HOST=example.org`. You should then be able to access your metrics at `http://example.org:9464/metrics`. GoToSocial running in this fashion will not serve LetsEncrypt certificates at the metrics endpoint, so you will be limited to using HTTP rather than HTTPS. +### Bare metal, with reverse proxy + If you are using a reverse proxy like Nginx, you can expose the metrics endpoint to the outside world with HTTPS certificates, by putting an additional location stanza in your Nginx configuration above the catch-all `location /` stanza: ```nginx @@ -49,6 +53,10 @@ location /metrics { This will instruct Nginx to forward requests to `example.org/metrics` to the separate Prometheus server running on port 9464. +### Docker + +If you are running GoToSocial inside a Docker container, to make the metrics endpoint reachable from outside of the container, you will have to set `OTEL_EXPORTER_PROMETHEUS_HOST` to either `0.0.0.0` or the ip address / hostname of the Docker container. If you do not set this, you will only be able to access the metrics endpoint from within the Docker container itself, which is probably not what you want. + ## Enabling basic authentication Although there is no sensitive data contained in the OTEL runtime statistics exported by Prometheus, you may nevertheless wish to gate access to the `/metrics` endpoint behind some kind of authentication, to prevent every Tom, Dick, and Harry from looking at your runtime stats. |
