facebook / akd

An implementation of an auditable key directory
Apache License 2.0
247 stars 36 forks source link

Add Support for Tracing #453

Closed dillonrg closed 1 month ago

dillonrg commented 1 month ago

Context The tracing crate enables more robust instrumentation of Rust programs compared to basic logging. With this patch, we introduce the tracing crate into AKD and only enable it when the tracing feature is specified. By default, the feature is disabled and we continue to leverage basic logging.

In addition to adding tracing based logging and instrumentation throughout the akd lib (i.e. not akd_core), various grammatical and organizational improvements were made in areas where tracing was being added. Notably, the log_metrics functions which exist throughout the storage layer were updated to simply log with info level instead of taking an argument to specify the level. Rationale being that the log_metrics functions are only called when the runtime_metrics feature is enabled and info is a fair median to assume.

Testing Since no major functional changes were made, the changes were tested via existing automated tests with various different feature flags being passed to toggle tracing on and off.

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.91%. Comparing base (3ce5335) to head (f5ce4e2). Report is 18 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #453 +/- ## ========================================== - Coverage 88.61% 87.91% -0.71% ========================================== Files 39 38 -1 Lines 9109 8192 -917 ========================================== - Hits 8072 7202 -870 + Misses 1037 990 -47 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

slawlor commented 1 month ago

whoops totally missed that this was already merged, sorry!