workleap/wl-telemetry
Overview
This skill documents Workleap's telemetry solution (@workleap/telemetry) that unifies Honeycomb, LogRocket, and Mixpanel with consistent correlation IDs. It explains initialization, correlation value lifecycle, platform roles, and safe usage patterns for development, testing, and production. Follow the guidance to get consistent traces, session replays, and analytics without inventing custom APIs.
How this skill works
The library provides a single initializeTelemetry entrypoint that sets up Honeycomb, LogRocket, and Mixpanel clients and circulates two automatic correlation IDs: Telemetry Id (per app load) and Device Id (per device across sessions). Honeycomb receives tracing and RUM data; LogRocket captures session replays and debugging context; Mixpanel records product analytics. Correlation IDs and LogRocket session URL are injected into each platform automatically so you can correlate traces, replays, and events across tools.
When to use it
- When bootstrapping telemetry in a frontend app via initializeTelemetry and TelemetryProvider.
- When you need consistent correlation across Honeycomb traces, LogRocket replays, and Mixpanel events.
- When instrumenting OpenTelemetry traces/spans for distributed tracing and frontend performance.
- When exposing telemetry identifiers to LogRocket for cross-tool debugging.
- When disabling telemetry in Storybook/tests using NoopTelemetryClient.
Best practices
- Always use the umbrella @workleap/telemetry APIs — do not invent or patch undocumented hooks.
- Never manually set Telemetry Id or Device Id; let the client manage correlation values.
- Use NoopTelemetryClient in Storybook and test environments to avoid sending data.
- Avoid logging PII into LogRocket; use data-public/data-private attributes to mark fields.
- Supply productFamily ("wlp" or "sg") to initializeTelemetry as required.
Example use cases
- Initialize telemetry in app bootstrap and wrap the app with TelemetryProvider for automatic correlation.
- Add OpenTelemetry spans and enrich Honeycomb traces with user-facing metadata for performance debugging.
- Expose LogRocket session URL into Honeycomb and Mixpanel for quick cross-tool investigation of a user issue.
- Attach Telemetry Id and Device Id to Mixpanel events to link analytics with traces and replays.
- Replace real clients with NoopTelemetryClient in Storybook to validate UI without external calls.
FAQ
Correlation is automatic: Telemetry Id (app load) and Device Id (device) are attached to each platform. When LogRocket is enabled, its session URL is also propagated to Honeycomb and Mixpanel.
Can I use the library in Storybook or tests?
Yes. Use NoopTelemetryClient to disable real telemetry and avoid sending data from non-production environments.