Dart SDK
Pub package talaria — exceptions, scoped logging, batched ingest, and optional tracing.
Building a Flutter app? Use the Flutter guide for framework error hooks and widget-aware setup.
Install
Add the package to your pubspec.yaml, then run dart pub get. Until the package is on pub.dev, depend on the GitHub path or a path override from the Talaria SDK repo.
dependencies:
talaria: ^0.1.0Configure
Use a project API key (tal_live_…). Prefer compile-time or runtime config — never hardcode keys in source.
import 'package:talaria/talaria.dart';
await Talaria.init(TalariaOptions(
dsn: const String.fromEnvironment(
'TALARIA_DSN',
defaultValue: 'https://api.newtalaria.com',
),
apiKey: const String.fromEnvironment('TALARIA_API_KEY'),
environment: const String.fromEnvironment(
'APP_ENV',
defaultValue: 'production',
),
release: const String.fromEnvironment('APP_RELEASE'),
minLevel: SeverityLevel.warning,
));Capture exceptions
try {
await riskyOperation();
} catch (error, stackTrace) {
await Talaria.captureException(
error,
stackTrace: stackTrace,
context: CaptureContext(tags: {'area': 'checkout'}),
);
rethrow;
}Scoped logging
Prefer a scoped logger for application code. Level methods wrap captureMessage; use captureException for errors.
final logger = Talaria.logger(tags: {'feature': 'checkout'});
await logger.warn('Payment method missing');
await logger.captureException(err, stackTrace: st);Performance tracing
Tracing is off until enableTracing is true or tracesSampleRate is greater than 0. Head-based sampling: 100% of error transactions; default 10% of successful. The SDK records HTTP client spans and custom transactions. Inspect waterfalls and RED in Performance. Child spans are not billed — only sampled root transactions.
await Talaria.init(TalariaOptions(
dsn: 'https://api.newtalaria.com',
apiKey: const String.fromEnvironment('TALARIA_API_KEY'),
environment: 'production',
enableTracing: true,
tracesSampleRate: 0.1, // 10% of successful transactions; errors always traced
));Already running an OpenTelemetry Collector? That is an advanced path — export OTLP/HTTP JSON to POST /otlp/v1/traces. Prefer the native SDK unless you already operate a Collector. See the API overview.
Environments & releases
Set environment and optional release from your build config or CI so the dashboard can filter issues and correlate deploys. Aliases like prod / dev are accepted.
Troubleshooting
- 401/403 — check API key and that it belongs to the target project.
- No issue appears — confirm environment filter in the dashboard.
- Rejected events — validate JSON shape against the API overview.
Prefer another platform? See all SDKs or send events over HTTP via the API overview.