Add Grape content logger to log content length and range
What does this MR do?
This merge request adds another Grape logger. the ContentLogger will long Content-Length and HTTP Content-Range if these are available.
This is going to result in a following log line in case of build trace PATCH request (tested in GitLab Compose Kit):
{"time":"2020-10-26T11:25:00.153Z","severity":"INFO","duration_s":0.01361,"db_duration_s":0.00493,"view_duration_s":0.00868,"status":202,"method":"PATCH","path":"/api/v4/jobs/1221/trace","params":[],"host":"192.168.1.15","remote_ip":"172.18.0.1","ua":"gitlab-runner 13.6.0~beta.185.gebcdf469 (master; go1.13.8; linux/amd64)","route":"/api/:version/jobs/:id/trace","queue_duration_s":0.07728,"redis_calls":9,"redis_duration_s":0.001406,"redis_read_bytes":17,"redis_write_bytes":2393,"redis_cache_calls":1,"redis_cache_duration_s":0.000214,"redis_cache_read_bytes":2,"redis_cache_write_bytes":108,"redis_shared_state_calls":8,"redis_shared_state_duration_s":0.001192,"redis_shared_state_read_bytes":15,"redis_shared_state_write_bytes":2285,"correlation_id":"1lDAerUBmGa","meta.user":"root","meta.project":"root/test-trace-range","meta.root_namespace":"root","meta.caller_id":"/api/:version/jobs/:id/trace","content_length":"795","content_range":"640-1434"}
Conformity
Issues
Edited by Grzegorz Bizon