API structured logs should include a route identifier
Currently structured logs for API calls don't expose any details of the route/endpoint on which the call was made.
{
"time": "2018-09-03T15:23:06.294Z",
"severity": "INFO",
"duration": 14.23,
"db": 2.46,
"view": 11.77,
"status": 202,
"method": "PATCH",
"path": "/api/v4/jobs/123/trace",
"host": "gitlab.com",
"ip": "1.1.1.1",
"ua": "gitlab-runner 11.2.0-rc2 (; go1.8.7; linux/amd64)",
"queue_duration": 7.8,
"tag": "rails.api",
"environment": "gprd",
"hostname": "api-08-sv-gprd",
"fqdn": "api-08-sv-gprd.c.gitlab-production.internal",
"message": null
}
This makes it difficult to find all log information associated with a particular endpoint. Additionally, it is not possible to aggregate in ELK by route.
Having an attribute representing the route allows us to determine the status and health of an individual endpoint without having to work back from the path, which is difficult / not always possible.