Commit 9d38778f authored by Evan Read's avatar Evan Read

Merge branch 'doc-update-database-load-balancing-log-docs' into 'master'

Update docs for database load balancing logs

See merge request gitlab-org/gitlab-ce!32535
parents a3281912 15b2e488
...@@ -212,28 +212,25 @@ without it immediately leading to errors being presented to the users. ...@@ -212,28 +212,25 @@ without it immediately leading to errors being presented to the users.
## Logging ## Logging
The load balancer logs various messages, such as: The load balancer logs various events in
[`database_load_balancing.log`](logs.md#database_load_balancinglog-premium-only), such as
- When a host is marked as offline - When a host is marked as offline
- When a host comes back online - When a host comes back online
- When all secondaries are offline - When all secondaries are offline
- When a read is retried on a different host due to a query conflict
Each log message contains the tag `[DB-LB]` to make searching/filtering of such The log is structured with each entry a JSON object containing at least:
log entries easier. For example:
``` - An `event` field useful for filtering.
[DB-LB] Host 10.123.2.5 came back online - A human-readable `message` field.
[DB-LB] Marking host 10.123.2.7 as offline - Some event-specific metadata. For example, `db_host`
[DB-LB] Marking host 10.123.2.7 as offline - Contextual information that is always logged. For example, `severity` and `time`.
[DB-LB] Marking host 10.123.2.7 as offline
[DB-LB] Marking host 10.123.2.7 as offline For example:
[DB-LB] Marking host 10.123.2.7 as offline
[DB-LB] Host 10.123.2.6 came back online ```json
[DB-LB] Marking host 10.123.2.7 as offline {"severity":"INFO","time":"2019-09-02T12:12:01.728Z","correlation_id":"abcdefg","event":"host_online","message":"Host came back online","db_host":"111.222.333.444","db_port":null,"tag":"rails.database_load_balancing","environment":"production","hostname":"web-example-1","fqdn":"gitlab.example.com","path":null,"params":null}
[DB-LB] Marking host 10.123.2.7 as offline
[DB-LB] Marking host 10.123.2.7 as offline
[DB-LB] Host 10.123.2.7 came back online
[DB-LB] Host 10.123.2.7 came back online
``` ```
## Handling Stale Reads ## Handling Stale Reads
......
...@@ -339,11 +339,11 @@ installations from source. ...@@ -339,11 +339,11 @@ installations from source.
[Rack Attack]: ../security/rack_attack.md [Rack Attack]: ../security/rack_attack.md
[Rate Limit]: ../user/admin_area/settings/rate_limits_on_raw_endpoints.md [Rate Limit]: ../user/admin_area/settings/rate_limits_on_raw_endpoints.md
## `database_load_balancing.log` ## `database_load_balancing.log` **(PREMIUM ONLY)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15442) in GitLab 12.3. > [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15442) in GitLab 12.3.
This log is used for observability of [Database Load Balancing](database_load_balancing.md). Contains details of GitLab's [Database Load Balancing](database_load_balancing.md).
It is stored at: It is stored at:
- `/var/log/gitlab/gitlab-rails/database_load_balancing.log` for Omnibus GitLab packages. - `/var/log/gitlab/gitlab-rails/database_load_balancing.log` for Omnibus GitLab packages.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment