Expand description
Analytics service - public API for event logging
This module serves as the main entry point for analytics events.
DESIGN: This module has NO dependencies to avoid import cycles. Events are queued until attach_analytics_sink() is called during app initialization. The sink handles routing to Datadog and 1P event logging.
Re-exports§
pub use config::*;pub use datadog::*;pub use first_party_event_logger::*;pub use first_party_event_logging_exporter::*;pub use growthbook::*;pub use metadata::*;pub use sink::*;pub use sink_killswitch::*;
Modules§
- config
- datadog
- first_
party_ event_ logger - first_
party_ event_ logging_ exporter - growthbook
- metadata
- sink
- sink_
killswitch
Traits§
- Analytics
Sink - Sink interface for the analytics backend
Functions§
- attach_
analytics_ sink - Attach the analytics sink that will receive all events. Queued events are drained asynchronously via microtask to avoid adding latency to the startup path.
- log_
event - Log an event to analytics backends (synchronous)
- log_
event_ async - Log an event to analytics backends (asynchronous)
- reset_
for_ testing - Reset analytics state for testing purposes only.
- strip_
proto_ fields - Strip
_PROTO_*keys from a payload destined for general-access storage. Used by sink.rs before Datadog fanout and first_party_event_logging_exporter for defensive stripping after hoisting known PROTO* keys.
Type Aliases§
- Analytics
Metadata PiiTagged - Marker type for values routed to PII-tagged proto columns
- Analytics
Metadata Verified - Marker type for verifying analytics metadata doesn’t contain sensitive data
This type forces explicit verification that string values being logged
don’t contain code snippets, file paths, or other sensitive information.
Usage:
my_string as AnalyticsMetadataVerified - LogEvent
Metadata - Log event metadata type