Skip to content

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

@heruan

Description

@heruan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions