mozilla-services / topsites-proxy

Proxy server to track Top Sites default tile campaign attribution
Other
8 stars 2 forks source link

Enhance logs to support troubleshooting errors #52

Open sciurus opened 3 years ago

sciurus commented 3 years ago

Right now, when the top sites proxy returns an error code like 500 it is difficult to determine if it is because

a) the partner returned this error and we are proxying the response b) the proxy itself experienced an error

I think a good way to address this is to add some more fields to the logs. Here are two that I would find useful specifically for requests under /cid/

and here are three I'd find useful for all requests.

For timings, seconds with millisecond accuracy (e.g. 0.123) would be good. If for some reason we didn't receive or send a response code, we could log 0.

sciurus commented 3 years ago

@jbuck anything else come to your mind that the proxy should log?

jbuck commented 3 years ago

hmmm, are there any other upstream headers that we'd be interested in logging? other than that, latency and response code is good

sciurus commented 3 years ago

I can't think of any headers we'd want that aren't in the nginx logs, and once we have x-cloud-trace logged by the app we can tie the two together.