Skip to content

Commit

Permalink
Add information about --log-metrics flag to logging documentation (#…
Browse files Browse the repository at this point in the history
…695)

Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
  • Loading branch information
dannycjones authored Jan 9, 2024
1 parent 261257b commit b9ca6b3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/LOGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,20 @@ You can enable more verbose logging with the `--debug` command-line argument. We
To enable more verbose logging for the AWS Common Runtime that Mountpoint uses to communicate with S3, use the `--debug-crt` command-line argument. These logs are very verbose, and should be combined with the `-l, --log-directory` and `--debug` arguments described above.

For finer-grained control over log verbosity, Mountpoint uses the `MOUNTPOINT_LOG` environment variable, which overrides the verbosity options above. The `MOUNTPOINT_LOG` environment variable uses the [`tracing-subscriber` directive syntax](https://docs.rs/tracing-subscriber/0.3.17/tracing_subscriber/filter/struct.EnvFilter.html), and can be used to control log verbosity on a per-subject basis. For example, setting `MOUNTPOINT_LOG` to `trace` enables all trace-level logs, while `trace,awscrt=warn` enables trace-level logs for all log subjects except `awscrt`, which has only warning-level logging enabled.

## Metrics

Mountpoint optionally collects metrics measuring various values across different components.
For example, Mountpoint records the durations of FUSE operations and the number of S3 responses grouped by HTTP status code.

To opt-in, use the `--log-metrics` command-line argument.
Metrics will be collected by Mountpoint and flushed to the logs every five seconds.
See below an example of what the emitted metrics may look like in the logs.

[INFO] mountpoint_s3::metrics: fuse.io_size[type=read]: n=4: min=3184 p10=3199 p50=16511 avg=26494.00 p90=70143 p99=70143 p99.9=70143 max=70143
[INFO] mountpoint_s3::metrics: fuse.op_latency_us[op=lookup]: n=8: min=22912 p10=23039 p50=65023 avg=62632.00 p90=95231 p99=95231 p99.9=95231 max=95231
[INFO] mountpoint_s3::metrics: fuse.op_latency_us[op=open]: n=3: min=24448 p10=24575 p50=64255 avg=54037.33 p90=73727 p99=73727 p99.9=73727 max=73727
[INFO] mountpoint_s3::metrics: fuse.total_bytes[type=read]: 105584 (n=4)

We recommend using the metrics only for debugging at this time.
Metrics are currently output in an unstructured format and are subject to change in future releases.

0 comments on commit b9ca6b3

Please sign in to comment.