cockroachdb / cockroachdb/cockroach
pkg/util/log: HTTP log sink has inefficiencies
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
- Incorrect allocation of dynamic headers map: it derives from [FileBasedHeaders](https://github.com/cockroachdb/cockroach/blob/588257ea305973292821d38622ad84ed1df83996/pkg/util/log/http_sink.go#L67) but its size is based on [allocated from Headers](https://github.com/cockroachdb/cockroach/blob/588257ea305973292821d38622ad84ed1df83996/pkg/util/log/http_sink.go#L63).
- Custom headers are not added to GET requests. (this might be a feature instead of a bug but still don't understand the reasoning behind it). [source](https://github.com/cockroachdb/cockroach/blob/588257ea305973292821d38622ad84ed1df83996/pkg/util/log/http_sink.go#L178)
- A new gzip writer is being created for every request instead of reusing it: [source](https://github.com/cockroachdb/cockroach/blob/588257ea305973292821d38622ad84ed1df83996/pkg/util/log/http_sink.go#L132).
- Repeated creation of requests and modification instead of cloning them.
Jira issue: CRDB-53074
Contributor guide
Assessment
This issue has not been assessed yet.