Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a init function for frontend observability [Hilla] #218

Open
heruan opened this issue May 17, 2023 · 0 comments
Open

Provide a init function for frontend observability [Hilla] #218

heruan opened this issue May 17, 2023 · 0 comments

Comments

@heruan
Copy link
Member

heruan commented May 17, 2023

The Hilla demo uses this function to initialize the frontend observability insturmentation:

export default function initTelemetry(): void {
const provider = new WebTracerProvider();
provider.register({
contextManager: new ZoneContextManager(),
});
provider.addSpanProcessor(
new SimpleSpanProcessor(
new HillaEndpointExporter({
// eslint-disable-next-line @typescript-eslint/no-misused-promises
endpoint: ObservabilityEndpoint.export,
}),
),
);
registerInstrumentations({
instrumentations: [new DocumentLoadInstrumentation()],
});
}

We should provide this functionality embedded in the kit to facilitate the initialization of frontend observability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant