Skip to content

Include a request ID in each log line

Adam Coldrick requested to merge sotk/logging/log-request-id into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s)

This is just a logging change, no need for metrics or docs.

Description

This MR adds support for tracking a unique ID for the scope of a gRPC request, and updates the logging format to include this request ID. This change will make it easier to filter the logs to find all of the logging related to a specific gRPC request, making it easier to investigate issues that occur in the process of handling that request.

Validation

Run a BuildGrid instance and send some requests to it, and observe the request IDs being displayed in the logs.

docker-compose -f docker-compose.all-in-one.yml up --build -d
tox -e venv -- bgd execute command ./buildgrid ls
docker logs buildgrid_controller_1
docker-compose -f docker-compose.all-in-one.yml down

Merge request reports