Skip to content

Conversation

@glitch003
Copy link

@glitch003 glitch003 commented Nov 25, 2025

starting on a privacy_mode param that would suppress logs and tracing for just that single request. requested by Polaris / Osmosis

How it works

We added a "X-Privacy-Mode" header in https://github.com/LIT-Protocol/lit-peer/pull/17/files#diff-444d506d6b348808f56db7bb8fb7c677ee5f67b68bf3457a8c04c7c3630f6c04 which sets a variable to suppress logging and tracing for the duration of that rocket request, and only for that request.

If privacy mode is enabled, we don't get any metrics, not even on endpoint usage. So, if privacy mode is enabled, we also log the request method and path before turning off logging, so that we can at least track those basic metrics of how many times an endpoint was hit.

To enable this, we added a SubscriberExt layer let subscriber = subscriber.with(crate::utils::rocket::privacy_mode::PrivacyModeLayer); that will disable logging and tracing when privacy mode is set.

Tests

We have a test of this new header, but it only checks for logs. We probably need to manually check that the traces are excluded too.

@glitch003 glitch003 marked this pull request as ready for review November 26, 2025 00:49
@github-actions
Copy link

github-actions bot commented Nov 26, 2025

PASS [ 43.617s] (3/3) lit_node::test toxiproxy::perf_tests::load_with_no_latency
PASS [ 43.753s] (2/3) lit_node::test toxiproxy::perf_tests::load_with_50ms_latency_single_link
PASS [ 95.000s] (1/3) lit_node::test toxiproxy::perf_tests::load_with_50ms_latency_all_links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants