#
TelemetryClient
Don't create your own instance of TelemetryClient, use the initializeTelemetry function instead.
#
Reference
const client = new TelemetryClient(logRocketClient?, honeycombClient?, mixpanelClient?);
#
Parameters
logRocketClient: An optional LogRocketInstrumentationClient instance.honeycombClient: An optional HoneycombInstrumentationClient instance.mixpanelClient: An optional MixpanelClient instance.
#
Getters
logRocketClient: Return the LogRocketInstrumentationClient instance.honeycombClient: Return the HoneycombInstrumentationClient instance.mixpanelClient: Return the MixpanelClient instance.
#
Usage
#
LogRocket instrumentation client
import { useTelemetryClient } from "@workleap/telemetry/react";
const client = useTelemetryClient();
client.logRocket.registerGetSessionUrlListener(sessionUrl => {
console.log(sessionUrl);
});
#
Honeycomb instrumentation client
import { useTelemetryClient } from "@workleap/telemetry/react";
const client = useTelemetryClient();
client.honeycomb.setGlobalSpanAttributes({
"app.user_id": "123"
});
#
Mixpanel client
import { useTelemetryClient } from "@workleap/telemetry/react";
const client = useTelemetryClient();
client.mixpanel.setGlobalEventProperties({
"User Id": "123"
});
See also
initializeTelemetry
productFamily: wlp or sg.
NoopTelemetryClient
A fake implementation of TelemetryClient for use in non-standard contexts such as unit tests and Storybook.
Reference
initializeTelemetry
TelemetryProvider
React provider to share a TelemetryClient instance with the application code.
useTelemetryClient
Retrieve a TelemetryClient instance.