Monitoring with Prometheus
The /metrics technical endpoint of the enterprise service returns metrics in the Prometheus format. You can use it to connect monitoring systems.
These are technical service metrics. Documentation reading statistics are collected by the space metrics module (see GES Database), and portal traffic by web analytics.
Enable metrics collection
Technical endpoints are disabled by default. To enable /metrics, add the ENABLE_TECH_ENDPOINTS=true variable to the enterprise service. In docker-compose.yaml the ENABLE_TECH_ENDPOINTS, TECH_ENDPOINTS_TOKEN, and ALLOW_UNSAFE_TECH_ENDPOINTS variables are already passed to the enterprise service — just fill them in .env.
If you enable only ENABLE_TECH_ENDPOINTS without specifying a protection method, the endpoint will not be available. Additionally configure one of the modes: protected access or unprotected access.
Configure protected access
The recommended option is to enable the endpoint and set a token for accessing technical endpoints:
ENABLE_TECH_ENDPOINTS=true TECH_ENDPOINTS_TOKEN=<CREATE_A_SECRET_KEY>
Pass the token in the Authorization header in requests to /metrics:
curl -H "Authorization: Bearer <CREATE_A_SECRET_KEY>" https://{ges_url}/metrics
If the token is missing or does not match TECH_ENDPOINTS_TOKEN, the service returns 401 Unauthorized.
Unprotected access
If the endpoint is available only within a closed internal network, you can allow access without a token:
ENABLE_TECH_ENDPOINTS=true ALLOW_UNSAFE_TECH_ENDPOINTS=true
Use this mode only if access to the service is restricted at the network level.
Check
After configuration, make sure the endpoint returns metrics.
For protected access:
curl -H "Authorization: Bearer <CREATE_A_SECRET_KEY>" https://{ges_url}/metrics
For unprotected access:
curl https://{ges_url}/metrics
The service returns text in the Prometheus format with the text/plain MIME type.
Other technical endpoints
Together with /metrics, these endpoints are enabled and protected by the same token:
/info— service build information./loggers— list of loggers and their levels. APOST /loggers/{name}request with thelevelfield (debug,info,warn, orerror) changes the logger level without a restart./apiand/api/doc— the service API description in the OpenAPI format and its Swagger UI view.
Documentation portal metrics
The documentation portal exposes its own metrics in the Prometheus format at https://{portal address}/api/metrics. The ENABLE_TECH_ENDPOINTS variable is not needed for this, and no token is required. If portal metrics must not be reachable from outside, close this path on the reverse proxy.