sapling/eden/mononoke/common
Kostia Balytskyi 7995ae5e85 observability: add scuba verbose logging
Summary:
This diff adds an (as yet unused) option to log verbose scuba samples.

Here's the high-level overview.

In addition to doing `scuba_sample.log_with_msg` and `scuba_sample.log()`, you can now do `scuba_sample.log_with_msg_verbose()` and `scuba_sample.log_verbose()`. These two methods indicate that the intended sample is verbose and should go through some filtering prior to logging.

By default verbose samples are just not logged, but there are ways to override this via `ScubaObservabilityConfig`. Namely, the config has a "system" `ScubaVerbosityLevel`, which is either `Normal` or `Verbose`. When the level is `Verbose`, all samples are logged (those triggered by `.log_with_msg()`, `.log()`, `.log_with_msg_verbose()` and `.log_verbose()`. In addition to the "system" verbosity level, `ScubaObservabilityConfig` supports a few filtering overrides: a list of verbose sessions, a list of verbose unixnames and a list of verbose hostnames. Whenever a verbose sample's session, unixname or source hostname belongs to a corresponding list, the sample is logged.

`ScubaObservabilityConfig` is a struct, queried from `configerator` without the need to restart a service. Querying/figuring out whether logging is needed is done by the `ObservabilityContext` struct, which was introduced a few diffs earlier.

Note: I also want to add regex-based filtering for hostnames, as it's likely to be more useful than exact-match filtering, but I will do that later.

Reviewed By: StanislavGlebik

Differential Revision: D25232429

fbshipit-source-id: 057af95fc31f70d796063cefac5b8f7c69d7b3ef
2021-01-05 09:21:38 -08:00
..
allocation_tracing mononoke: reverse autocargo include list to excludes 2020-05-06 08:43:18 -07:00
async_limiter Regenerate all Cargo.tomls after upgrade to futures 0.3.5 2020-07-06 20:49:43 -07:00
bounded_traversal add variant of bounded_traversal_stream which accepts children in the form of a stream 2020-10-07 03:38:28 -07:00
dedupmap rust: update rust to 1.47.0 2020-10-15 17:28:02 -07:00
iterhelpers common: add iterhelpers 2020-10-04 23:51:03 -07:00
rust mononoke/mysql: use single static shared connection pool 2020-12-17 15:46:30 -08:00
scribe_ext mononoke: add Scribe 2020-06-29 12:15:22 -07:00
scuba_ext observability: add scuba verbose logging 2021-01-05 09:21:38 -08:00
sql_construct mononoke/mysql: use single static shared connection pool 2020-12-17 15:46:30 -08:00
topo_sort Prepare for rustfmt 2.0 2020-09-08 07:33:16 -07:00
type_map make it possible to store arbitrary type in blobrepo with dependency on it 2020-06-22 07:29:19 -07:00
uniqueheap mononoke: make blobrepo and its dependencies OSS buildable 2020-03-31 04:02:45 -07:00