mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
Potentially useful context when determining the source of a request.
This change mostly just adds a field, but some additional diffs:
- rewrite the audit log tests to use autogold for in-depth assertion
- move request logging in Cody Gateway further down the stack so that we
have all context available
## Test plan
```
sg start dotcom
```
Do a cody interaction:
```
[ cody-gateway] DEBUG cody-gateway requestlogger/requestlogger.go:34 Request {"TraceId": "a2cf1a35a3094c57e3fcc9688c5c9819", "SpanId": "f38e261c6cce8687", "actor.ID": "7b823673-c9ff-46d7-a80d-e0d6ba0b3469", "actor.Source": "dotcom-product-subscriptions", "actor.AccessEnabled": true, "actor.LastUpdated": 1687281754512940000, "requestClient.ip": "127.0.0.1", "requestClient.forwardedFor": "", "requestClient.userAgent": "Sourcegraph-Bot", "method": "POST", "path": "/v1/completions/anthropic", "response.statusCode": 200, "duration": "2.342545917s"}
```
Not a terribly useful user agent but oh well
|
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| client.go | ||
| grpc_test.go | ||
| grpc.go | ||
| http.go | ||