summaryrefslogtreecommitdiff
path: root/client/gitlabnet.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix formatting via make fmtStan Hu2021-07-261-3/+3
|
* Switch to labkit/log for logging functionalityIgor Drozdov2021-07-221-12/+7
|
* Log Content-Length bytes in API resposneStan Hu2020-11-021-0/+4
| | | | | This will be useful to measure bandwidth sent in response to an API request, particularly with measuring the /api/v4/internal/lfs endpoint.
* client: Allow User-Agent header to be overriddenzj-override-user-agentZeger-Jan van de Weg2020-10-141-2/+14
| | | | | | | | | | The user agent for requests to the internal API endpoints used the default Go provided user agent. This change updates that to always set something else, by default `GitLab-Shell`. Than for others importing the package, there's a new API to set it to something else. This has been done with new method, a setter, to maintain backwards compatibility in the API.
* Make it possible to propagate correlation ID across processesStan Hu2020-09-201-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, gitlab-shell did not pass a context through the application. Correlation IDs were generated down the call stack instead of passed around from the start execution. This has several potential downsides: 1. It's easier for programming mistakes to be made in future that lead to multiple correlation IDs being generated for a single request. 2. Correlation IDs cannot be passed in from upstream requests 3. Other advantages of context passing, such as distributed tracing is not possible. This commit changes the behavior: 1. Extract the correlation ID from the environment at the start of the application. 2. If no correlation ID exists, generate a random one. 3. Pass the correlation ID to the GitLabNet API requests. This change also enables other clients of GitLabNet (e.g. Gitaly) to pass along the correlation ID in the internal API requests (https://gitlab.com/gitlab-org/gitaly/-/issues/2725). Fixes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/474
* Generate and log correlation IDsStan Hu2020-07-311-9/+21
| | | | | This will make it easier to tie an SSH access request to Rails API and Gitaly requests.
* Add HTTP status code to internal API logsStan Hu2020-05-081-3/+7
| | | | This would make it easier to filter the logs by status code.
* Move gitlabnet client to client packagejc-refactor-gitlabnet-clientJohn Cai2020-05-041-0/+140