Glean is a modern telemetry system by Mozilla for collecting, storing, and sending application metrics and pings. It provides a type-safe, cross-platform SDK with a metric API, automatic batching, and built-in pings. Current version is 67.2.0, with a regular release cadence aligned with Mozilla's release cycle.
pip install glean-sdkVerified import paths — ran on the pinned version, not inferred.
Minimal example initializing Glean with a configurable server endpoint and a boolean metric.
Replace all `from glean_sdk import ...` with `from glean import ...`.
Remove MetricsPing usage; pings are now scheduled automatically. Use `Glean.initialize(...)` without explicitly scheduling pings.
Pass `data_dir` inside `Configuration` object.
Initialize Glean at application startup, guarded by a flag or on first launch.
Ensure metric strings follow the '[a-z][a-z0-9-]{0,}[.][a-z][a-z0-9-]{0,}' pattern.Use 'from glean import ...' instead of 'from glean_sdk import ...'.
Guard initialization with a flag or ensure single call at startup.
Use valid identifier format like 'test.bool'.
Remove MetricsPing; ping scheduling is automatic.