|
1 | 1 | --- |
2 | 2 | name: workleap-telemetry |
3 | 3 | description: | |
4 | | - Guide for @workleap/telemetry, Workleap's unified telemetry connecting Honeycomb, LogRocket, and Mixpanel with automatic correlation IDs. |
5 | | -
|
6 | | - Use this skill when: |
7 | | - (1) Initializing wl-telemetry in a frontend application |
8 | | - (2) Correlation values (Telemetry Id, Device Id) and cross-tool data correlation |
9 | | - (3) Honeycomb tracing, OpenTelemetry spans, and performance monitoring |
10 | | - (4) LogRocket session replay, user identification, and privacy controls |
11 | | - (5) Mixpanel analytics, event tracking, and cross-product tracking |
12 | | - (6) Configuring wl-telemetry diagnostic loggers (LogRocketLogger) |
13 | | - (7) Storybook/test setup with Noop telemetry clients |
14 | | - (8) Reviewing or troubleshooting telemetry instrumentation |
| 4 | + Guide for @workleap/telemetry — Workleap's unified telemetry package connecting Honeycomb (tracing), LogRocket (session replay), and Mixpanel (analytics) with automatic correlation IDs. |
| 5 | +
|
| 6 | + Use when initializing @workleap/telemetry, instrumenting Honeycomb traces/spans, configuring LogRocket replay or privacy, tracking Mixpanel events, setting up Noop clients for Storybook/tests, or troubleshooting telemetry correlation. Also activate when someone mentions observability, session replay, or analytics in a Workleap frontend context. |
15 | 7 | metadata: |
16 | | - version: 3.2 |
| 8 | + version: 3.3 |
17 | 9 | --- |
18 | 10 |
|
19 | 11 | # Workleap Telemetry (wl-telemetry) |
20 | 12 |
|
21 | 13 | `@workleap/telemetry` is an umbrella package that integrates Honeycomb, LogRocket, and Mixpanel with consistent correlation IDs for unified debugging and analysis. |
22 | 14 |
|
| 15 | +## Platform Roles |
| 16 | + |
| 17 | +- **Honeycomb**: Distributed tracing and performance monitoring (LCP, CLS, INP) |
| 18 | +- **LogRocket**: Session replay and frontend debugging |
| 19 | +- **Mixpanel**: Product analytics and event tracking |
| 20 | + |
| 21 | +## Quick Start |
| 22 | + |
| 23 | +```typescript |
| 24 | +import { initializeTelemetry, TelemetryProvider } from "@workleap/telemetry/react"; |
| 25 | + |
| 26 | +const telemetryClient = initializeTelemetry("wlp", { |
| 27 | + logRocket: { appId: "your-app-id" }, |
| 28 | + honeycomb: { |
| 29 | + namespace: "your-namespace", |
| 30 | + serviceName: "your-service", |
| 31 | + apiServiceUrls: [/.+/g], |
| 32 | + options: { proxy: "https://your-otel-proxy" } |
| 33 | + }, |
| 34 | + mixpanel: { |
| 35 | + envOrTrackingApiBaseUrl: "production" |
| 36 | + } |
| 37 | +}); |
| 38 | + |
| 39 | +<TelemetryProvider client={telemetryClient}> |
| 40 | + <App /> |
| 41 | +</TelemetryProvider> |
| 42 | +``` |
| 43 | + |
23 | 44 | ## Critical Rules |
24 | 45 |
|
25 | | -1. **Use umbrella package** — Always use `@workleap/telemetry`, not standalone packages |
26 | | -2. **Do not invent APIs** — Only use documented APIs from references |
27 | | -3. **Correlation is automatic** — Never manually set Telemetry Id or Device Id; never create your own `TelemetryContext` instances |
28 | | -4. **Noop for non-production** — Use `NoopTelemetryClient` in Storybook/tests |
29 | | -5. **Privacy matters** — Never log PII to LogRocket; use `data-public`/`data-private` attributes |
30 | | -6. **productFamily is required** — `initializeTelemetry` requires `"wlp"` or `"sg"` as the first argument |
| 46 | +1. **Use the umbrella package** — Import from `@workleap/telemetry`, not standalone packages like `@workleap/honeycomb` directly. Standalone packages bypass the automatic correlation ID propagation that ties all three platforms together. |
| 47 | +2. **Do not invent APIs** — Only use APIs documented in the references. The model may hallucinate plausible-looking methods that don't exist. |
| 48 | +3. **Let correlation happen automatically** — Never manually set Telemetry Id or Device Id, and never create your own `TelemetryContext` instances. The SDK manages the lifecycle and cross-tool propagation; manual overrides break the correlation chain. |
| 49 | +4. **Use Noop clients outside production** — Use `NoopTelemetryClient` in Storybook and tests to avoid sending real telemetry data and to prevent initialization errors in non-browser environments. |
| 50 | +5. **Protect user privacy** — Never log PII to LogRocket. Session replays are shared across teams and may be reviewed broadly; use `data-public`/`data-private` HTML attributes to control what gets recorded. |
| 51 | +6. **productFamily is required** — `initializeTelemetry` requires `"wlp"` (Workleap Platform) or `"sg"` (ShareGate) as the first argument. This determines platform-specific defaults and routing. |
31 | 52 |
|
32 | 53 | ## Reference Guide |
33 | 54 |
|
34 | | -For detailed documentation beyond the rules above, consult: |
| 55 | +Consult these references based on what you need: |
35 | 56 |
|
36 | | -- **`references/api.md`** — Initialization options, TelemetryClient properties, Honeycomb/LogRocket/Mixpanel client APIs, React hooks, Noop clients, LogRocketLogger |
37 | | -- **`references/integrations.md`** — Platform-specific configuration, Honeycomb tracing patterns, LogRocket privacy and user identification, Mixpanel event tracking, cross-platform correlation workflows |
38 | | -- **`references/examples.md`** — Full application setup, Storybook/test configuration, user identification, custom Honeycomb traces, Mixpanel tracking patterns, logging configuration, troubleshooting |
| 57 | +- **`references/api.md`** — Function signatures, type definitions, and complete API surface for all clients and hooks. Start here when you need to know exactly what parameters a method accepts. |
| 58 | +- **`references/integrations.md`** — Platform-specific configuration patterns, custom Honeycomb traces, LogRocket privacy controls, Mixpanel event tracking, and cross-platform correlation workflows. Start here for "how do I configure X" questions. |
| 59 | +- **`references/examples.md`** — Copy-paste starter code for common scenarios: full app setup, Storybook decorators, test utilities, user identification, and troubleshooting. Start here for "show me how to do X" questions. |
0 commit comments