Skip to content

Git designed for AI agents.

1.7 KB
Raw Blame

Setting up a local ELK stack for downloaded logs

You can set up a local ELK and import log files into it. A local ELK stack lets you analyze a customer's Gitaly logs with the same tooling used for Kibana. Troubleshooting then works the same way for GitLab.com and GitLab Self-Managed.

Start the stack

Requires Docker and Docker Compose.

  1. Clone docker-elk.

  2. Run docker compose up setup to create the prerequisites.

  3. Run docker compose up. Kibana comes up at localhost:5601, with username elastic and password changeme.

    elk-homepage.png

Import a log file

  1. Get the Gitaly log out of the support package. After unzipping, it is at <unzip dir>/var/log/gitlab/gitaly/current.

  2. In Kibana, search for upload to reach the file upload page.

    elk-upload.png

  3. Drag the log file onto the page. Any log file works, not only the Gitaly one.

    elk-impor-preview.png

  4. Under 'Override settings', set the time field to time or @timestamp. Choosing anything else may lead to empty results.

    elk-override-settings.png

  5. Name the index after the ticket number, so several investigations can coexist.

  6. Open 'Analytics > Discover' and select your index to read the logs.

    elk-view-logs.png

The Gitaly log fields, and the correlation ID to filter on first, are described in Logging in Gitaly.

Further reading