sapling/apiserver
Harvey Hunt 383162d019 mononoke: Use proper CoreContext in thrift server
Summary:
Previously, we were passing a specially created core context that doesn't
use a Scuba logger. Update this to use a CoreContext with a scuba logger in it.

NOTE: The scuba logger in the CoreContext isn't mutable, which means that to add new values to it,
the ScubaSampleBuilder needs to be cloned. However, this means that the contents of the sample will
diverge:

    let mut scuba = ctx.scuba().clone();
    scuba.add("foo", 1);

    // Won't contain foo
    ctx.scuba().log();

This is annoying for the API Server as it would be nice to pass CoreContext into the Repo actor and then
log some things from there (Such as params).

Mononoke works around this by cloning the ScubaSampleBuilder after common values have been added
(such as server information) and then logging to scuba at the end of each request. Perhaps we should do this
for the API Server too. i.e. we clone the ScubaSampleBuilder from CoreContext once we enter the Repo actor
code so that we have a central place to record params etc and log once the actor is done, logging another sample
once the Thrift or HTTP code is done too.

Reviewed By: StanislavGlebik

Differential Revision: D16341284

fbshipit-source-id: c28083b04643421d24270e54557552551b938394
2019-07-18 04:49:00 -07:00
..
client/src mononoke: Convert API Server to rust 2018 2019-07-17 11:38:41 -07:00
if Add MononokeThriftBackingStore 2019-05-21 12:24:52 -07:00
src mononoke: Use proper CoreContext in thrift server 2019-07-18 04:49:00 -07:00