Getting started
Demo telemetry
Fill an organization with realistic, linked telemetry, and seed integration tests from the same generators.
bun run --cwd packages/seeder seed --organization <id|slug>How it works
packages/seeder emulates the SDK and replays its output through the product's own ingest code, in process.
- It builds the OTLP traces and logs an instrumented shop would send.
- It runs them through
normalizeTraces,normalizeLogs, error deduplication,enrichErrorsandprocessErrorIntake, the same steps asapi-ingestandworker-errors. - It writes straight to Postgres, ClickHouse and object storage, so the ingest rate limits don't apply.
Every derived field, from span ops and transaction names to fingerprints, culprits and symbolicated stacks, comes from product code.
Each demo service writes to its own project, found by its slug: web, api, orders, payments, inventory and worker. Missing projects are created.
Options
| Option | Effect |
|---|---|
--organization | Id or slug of the organization to fill. Required. |
--days | Days of history, counting back from now. Defaults to 14. |
--volume | Multiplier on every daily rate, from 0.1 to 10. |
--seed | Generator seed. The same seed and window give the same data. |
--only | Subset of errors, logs and traces. |
--platform | server, browser or all, for backend-only or web-only projects. |
--reset | Delete the telemetry of the demo projects first. |
The seeder reads DATABASE_URL, the CLICKHOUSE_* variables and the STORAGE_S3_* variables from packages/seeder/.env. Without a bucket it skips source maps and browser stacks stay minified. bun run wt:setup points a worktree at its own database and bucket.
What it writes
| Data | Details |
|---|---|
| Traces | Server requests with database, cache, outgoing HTTP and function spans. Page loads with web vitals and fetches that continue into the backend trace. gRPC calls between services and a queue the worker service consumes. |
| Errors | Server and browser errors from a template catalog, raised the way the SDK raises them: unhandled request errors as exception events on the failed span, others as captured exception logs with breadcrumbs. |
| Source maps | One minified bundle and source map per release version, uploaded like openperf sourcemaps upload when storage is configured. Browser stacks arrive minified and are symbolicated by processErrorIntake. |
| Logs | Request, application and worker logs, linked to their spans. |
| Releases | Releases with a staging deploy 15 minutes before production. Telemetry reports the version deployed in its environment at that moment. |
| Triage | Groups resolved, ignored and regressed through updateErrorGroupStatus by the organization owner, with audit events dated in the past. |
The window holds a two-hour incident yesterday afternoon: latency, failures and error bursts rise on the routes marked as incident sensitive.
Linked records
A unit test generates several seeds on every platform and checks the normalized output against these rules:
- Every parent span exists in its trace, every trace has one root, and children start and end inside their parents. Queue consumers may outlive their producers.
- Every exception event has a matching error, a span raises at most one exception, and a segment holds at most one error per fingerprint.
- An error points to an existing span, happens inside it, and fails the span when it was raised on it.
- Errors and logs share the environment, service and version of their span, and errors also share its user.
- Logs linked to a span happen inside it.
- Error and log ids are ULIDs of their own timestamps, trace ids have 32 hex digits and span ids 16.
After a run, the seeder also checks that no resolved group received events after it was resolved.
Demo projects
The Create demo button in onboarding and in the empty project list opens a dialog whose Create calls POST /api/v1/projects/demo.
- Only owners and admins can call it.
- It works only while the organization has no projects; otherwise it answers
409 ORGANIZATION_HAS_PROJECTS. - A user can create the demo projects once an hour; the next attempt answers
429 DEMO_PROJECT_RATE_LIMITED. The limit lives in the state Redis and is off whenAPI_RATE_LIMIT_PER_MINUTEis0.
The endpoint creates one project per demo service with demo = 'seeding' and queues demo-project-seed for the organization; the dialog then polls the project list until the state changes. worker-jobs runs the job:
- It calls
seedDemofrom@openperf/seeder: 3 days at volume 1, the organization id as the seed, and the system actorOpenPerf Demoas the triage author. - It drops the cached ClickHouse reads of the projects, so pages opened while seeding don't keep partial data.
- It sets
demo = 'ready'.
| Failure | Outcome |
|---|---|
| The worker stops mid-seed. | The job has a 60-second heartbeat and two retries, so another worker takes it over. |
| A retry starts. | It first deletes what the previous attempt wrote. |
| The last attempt fails. | The job sets demo = 'failed'. |
| A demo project is deleted before the job starts. | The job sets the remaining ones to failed. |
| A demo project is deleted while seeding. | The job removes whatever it wrote for it. |
The DSN of a demo project is rejected by ingest, and webhooks skip its events, such as alerts of rules added to it by hand.
In tests
@openperf/seeder/testing builds one failed server request with its error and logs, and ingests it the same way:
import { seedTestTelemetry } from "@openperf/seeder/testing";
const { traceId, groupId, fingerprint } = await seedTestTelemetry({
clickhouse,
database,
projectId,
version: "web-2.0.0",
error: { stack: null },
});- The data depends only on the project id and the moment, so two projects never share a trace.
environment,versionand the error'stype,message,stackandhandledcan be overridden.- The seeder's integration test runs after the server suites, because it uses the test databases that their setup recreates.