Serverpod
Install talaria_serverpod 0.3.3 and wire the database interceptor.
talaria_serverpod 0.3.3 is the Serverpod 4 adapter. It re-exports the core API. Add both talaria ^0.4.1 and talaria_serverpod ^0.3.3. The package requires Serverpod ^4.1.0 (0.3.3 is compatible with 4.1.2).
Install#
dependencies:
talaria: ^0.4.1
talaria_serverpod: ^0.3.3
serverpod: ^4.1.0Initialise#
Pass databaseInterceptor to the Serverpod constructor — Serverpod does not allow swapping it later. interceptDatabase is a no-op until TalariaServerpod.init and until tracing is on.
final pod = Serverpod(
args,
Protocol(),
Endpoints(),
databaseInterceptor: TalariaServerpod.interceptDatabase,
experimentalFeatures: ExperimentalFeatures(
diagnosticEventHandlers: [
AsEventHandler<ExceptionEvent>((event, {required space, required context}) {
TalariaServerpod.handleExceptionEvent(event);
}),
],
),
);
await TalariaServerpod.init(TalariaOptions(
apiKey: 'tal_sk_prod_nz1_…',
release: '1.2.3',
minLevel: SeverityLevel.warning,
tags: {'service': 'my_api'},
));
TalariaServerpod.attach(pod);
await pod.start();Use a secret key. Init never throws: a disabled client skips the outbound HTTP patch, attach adds no middleware, and hooks pass through.
Verify#
await Talaria.captureException(Exception('Talaria test error'), stackTrace: StackTrace.current);Run this once, then open Issues in the dashboard. The test error shows as a new issue in the key's environment. Nothing there? See fail-safe.
Next#
See configuration, errors, and tracing.