gomods / gomods/athens

Proposal: add indication in logs whether returned data was in storage or not

Open
#892 8 comments 0 reactions 0 assignees View on GitHub
hosting proposal
Dominant language
Go
Stars
4.8k
Forks
542
Avg merge
7d 21h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**

Most production logs look like this:

```
handler: GET /github.com/arschles/assert/@v/list/ [200]
handler: GET /github.com/arschles/assert/@v/list/ [200]
handler: GET /github.com/arschles/assert/@v/list/ [200]
handler: GET /github.com/arschles/assert/@v/v1.0.0.mod [200]
handler: GET /github.com/arschles/assert/@v/v1.0.0.mod [200]
handler: GET /github.com/arschles/assert/@v/v1.0.0.info [200]
handler: GET /github.com/arschles/assert/@v/v1.0.0.zip [200]
```

It's not really a problem, but read on because we could possibly make these better 😄

**Describe the solution you'd like**

Those logs are nice, but for debugging it can be useful to tell whether the data being returned (for info, mod and zip requests) was from the storage. For `/list` responses, it can also be useful to tell whether the call to the upstream was successful or not (i.e. whether we fell back to storage)

**Describe alternatives you've considered**

I think we could use tracing to get this information instead. Maybe that's just a better choice?

**Additional context**

I'm researching and preparing for #772 and found that some way to tell whether a response was cached or not would be really helpful for us.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.