Telemetry: SDKs
Install and initialise the TaskTrooper Telemetry SDK for Go, Java and Kotlin, .NET, Python, Node.js, browser, React, React Native, Android, iOS and Flutter.
Install and initialise the SDK for each platform. SDKs never crash the host app, batch in the background and collect no headers, bodies or query strings by default. Each SDK links to its README on GitHub for the full reference.
Backend
Go
net/http, chi, gin, gRPC, database/sql, Kafka, Redis and more through optional integration modules.
Install:
go get github.com/makifbaysal/tasktrooper-telemetry/sdks/go
Initialise:
import trooper "github.com/makifbaysal/tasktrooper-telemetry/sdks/go"
shutdown, err := trooper.Start(ctx, trooper.Config{
DSN: os.Getenv("TROOPER_DSN"),
Service: "orders-api",
})
if err != nil {
log.Printf("telemetry disabled: %v", err)
}
defer shutdown(context.Background())
Java / Kotlin
Zero-code Java agent, or Spring Boot 3, Quarkus and Ktor modules from Maven Central.
Install:
// build.gradle.kts
repositories { mavenCentral() }
dependencies { implementation("ai.tasktrooper:trooper-spring-boot-starter:0.1.0") }
Initialise:
export TROOPER_DSN=https://<ingest-key>@telemetry-ingest.tasktrooper.ai/<project-id>
export TROOPER_SERVICE=orders-api TROOPER_ENV=production
java -javaagent:trooper-javaagent.jar -jar app.jar
.NET
ASP.NET Core and worker services; route templates come from the matched endpoint.
Install:
dotnet add package TaskTrooper.Telemetry
dotnet add package TaskTrooper.Telemetry.AspNetCore
Initialise:
builder.Services
.AddTaskTrooper(o =>
{
o.Dsn = Environment.GetEnvironmentVariable("TROOPER_DSN");
o.ServiceName = "orders-api";
})
.AddAspNetCore();
Python
FastAPI, Flask and Django; initialise before the app is created.
Install:
pip install tasktrooper
Initialise:
import os
import tasktrooper
tasktrooper.init(
dsn=os.environ["TROOPER_DSN"],
service="orders-api",
)
# … then create your FastAPI / Flask / Django app
Node.js
Express, Fastify, NestJS and the common clients; works with or without code.
Install:
npm install @tasktrooper/node
Initialise:
import { init } from '@tasktrooper/node';
init({ dsn: process.env.TROOPER_DSN, service: 'orders-api' });
// or without code: TROOPER_DSN=… node --import @tasktrooper/node/register app.mjs
Web
Browser
Page views, Web Vitals, JS errors, network calls and session replay for any web app.
Install:
npm install @tasktrooper/browser
Initialise:
import { init } from '@tasktrooper/browser';
init({
dsn: 'https://<ingest-key>@telemetry-ingest.tasktrooper.ai/<project-id>',
service: 'shop-web',
tracePropagationTargets: [/api\.example\.com/],
});
Use a browser ingest key restricted to your origins (Settings → API keys).
React
Provider, error boundary and router integrations; the view name is the route template.
Install:
npm install @tasktrooper/react
Initialise:
import { TrooperProvider, ErrorBoundary } from '@tasktrooper/react';
<TrooperProvider options={{ dsn, app: 'shop-web', version }}>
<ErrorBoundary name="root" fallback={({ resetError }) => <Crash onRetry={resetError} />}>
<App />
</ErrorBoundary>
</TrooperProvider>;
Vue (@tasktrooper/vue) and Angular (@tasktrooper/angular) wrap the same browser SDK.
Mobile
React Native
Screens, app start, JS errors and network calls; react-navigation route names become views.
Install:
npm install @tasktrooper/react-native
Initialise:
import { init, trooperNavigation } from '@tasktrooper/react-native';
init({ dsn, app: 'courier-app', environment: 'production' });
const nav = trooperNavigation(navigationRef);
Android
Screens, app start, crashes (including native), OkHttp calls, Compose and session replay.
Install:
dependencies {
implementation("ai.tasktrooper:trooper-android:0.1.0")
implementation("ai.tasktrooper:trooper-okhttp:0.1.0") // optional
}
Initialise:
class App : Application() {
override fun onCreate() {
super.onCreate()
TaskTrooper.init(this, TrooperConfig(
dsn = "https://<ingest-key>@telemetry-ingest.tasktrooper.ai/<project-id>",
app = "courier-app",
version = BuildConfig.VERSION_NAME,
))
}
}
iOS
UIKit and SwiftUI screens, app start, crashes, URLSession calls and session replay.
Install:
// Package.swift
.package(url: "https://github.com/makifbaysal/tasktrooper-telemetry", from: "0.1.0"),
.product(name: "TaskTrooper", package: "tasktrooper-telemetry"),
// or CocoaPods
pod 'TaskTrooper', '~> 0.1'
Initialise:
import TaskTrooper
TaskTrooper.start(TrooperConfig(
dsn: "https://<ingest-key>@telemetry-ingest.tasktrooper.ai/<project-id>",
app: "courier-app"
))
Call it as early as possible: in application(_:didFinishLaunchingWithOptions:) or the SwiftUI App initialiser.
Flutter
Screens, errors from both zones, app start and HTTP calls (Dio optional).
Install:
dependencies:
tasktrooper_flutter: ^0.1.0
tasktrooper_dio: ^0.1.0 # only if you use Dio
Initialise:
void main() {
TaskTrooper.init(
const TrooperConfig(dsn: 'https://<ingest-key>@telemetry-ingest.tasktrooper.ai/<project-id>', app: 'courier-app'),
appRunner: () => runApp(const MyApp()),
);
}