Add backwork to a service
About a minute per service. You add one package, start the service with it, and install the agent once on each server. Nothing else in your code changes.
1. Add Correlator
One package for every framework. Correlator finds what your service uses (Express, Hono, Fastify, Remix, Phoenix, BullMQ, Oban, Ecto, Postgres clients) and attaches to each one by itself.
$npm install correlator
2. Start your service with it
No code change: start the service with Correlator loaded first.
$node --import correlator/auto server.js
Prefer a line in your code? In Node and Bun, make import "correlator/auto" the first import.
3. Check it worked
Ask Correlator what it attached to. Anything it found but could not attach is listed with the reason.
// in your service, once it has startedimport { status } from "correlator";console.log(status());// attached hono, fetch, node-postgres, pino// found ioredis (add @correlator/ioredis for cache timing)// switches hop_records on · named_fields on · linked_ids on
Install the agent on a server
The agent reads your services' log lines and sends them to backwork. It runs once per server, not once per service, and it removes sensitive data before anything leaves the server.
$curl -fsSL https://backwork.dev/install.sh | sh -s -- --token <TOKEN>
Your services keep logging to standard output, as they do today. Your service itself needs no backwork token, endpoint or package.
Send without the agent
No access to the server, or nowhere to run the agent? Your service can post its lines to backwork itself. Nothing is installed and nothing on the server changes: you set one environment variable. The lines get the same switches, the same sensitive-data filter and the same request view and Performance figures as lines the agent sends.
Correlator's own lines
Set CORRELATOR_RECORD_SINK on the service, with your ingest token before the @ and the service name at the end. Correlator then posts its hop records and linked IDs to backwork, and your service's own log output stays as it is.
$CORRELATOR_RECORD_SINK=https://<TOKEN>@backwork.dev/ingest/records?service=my-api
Any line, from anything
The endpoint takes plain text, one line per log line, gzip optional. Post hop records, linked IDs and ordinary log lines together, up to 5 MB a post.
$curl -X POST https://backwork.dev/ingest/records \-H "Authorization: Bearer <TOKEN>" \-H "x-backwork-service: my-api" -H "x-backwork-host: web-1" \--data-binary @app.log
| Answer | Meaning |
|---|---|
200 | Stored. The body says how many lines were kept and how many your switches left out. |
401 | The token is missing or wrong. Bearer, x-backwork-token or the token in the URL all work. |
413 | Over 5 MB (or 20,000 lines). Send smaller batches. |
A line can carry its own time: put it first, then a tab. RFC 3339 or Unix nanoseconds both work. Without one, the line is stored at the time it arrives. Times more than 6 days old or 10 minutes ahead are replaced by the arrival time.
2026-11-17T18:40:01.123456Z<TAB>order 7731 placed1794940801123456000<TAB>trace_id=6503f5f1... hop=in_end ...
Platform log drains
On Vercel, Heroku, Fly.io or Cloudflare, the platform can send your logs itself. You add a drain in the platform's settings and change nothing in the service. The service and host come from the platform (the Vercel project, the Fly app, the Worker), and so do the level and the time. The Projects page has each platform's steps, ready to copy.
| Platform | Drain URL | Token |
|---|---|---|
| Vercel | /ingest/drains/vercel | Custom header Authorization: Bearer <TOKEN> |
| Heroku | /ingest/drains/heroku?service=my-api | In the drain URL: https://bw:<TOKEN>@backwork.dev/... |
| Fly.io | /ingest/drains/fly | Fly's log shipper: HTTP_URL and HTTP_TOKEN |
| Cloudflare Logpush | /ingest/drains/cloudflare | ?header_Authorization=Bearer%20<TOKEN>, which Cloudflare sends as a header |
Render and Railway have no drain backwork can take: Render sends logs to your own endpoint only as syslog over TCP, and Railway has no drain at all. Use the record sink above or OpenTelemetry instead.
AWS CloudWatch and Google Cloud Logging
Logs already in a cloud logging service can be pushed from there, with no agent and no change to the service. backwork keeps no cloud credentials: the cloud sends with your project token. The Projects page has console and CLI steps for both, ready to copy.
| Cloud | Route | Token |
|---|---|---|
| AWS | CloudWatch Logs subscription filter → Amazon Data Firehose → HTTP endpoint /ingest/cloud/aws/firehose | The Firehose access key |
| Google Cloud | Log Router sink → Pub/Sub topic → push subscription to /ingest/cloud/gcp/<TOKEN> | In the push endpoint path (a push subscription cannot set headers) |
On AWS the service is the log group (the function name for Lambda) and the level comes from Lambda's log format; set the Firehose buffer to 1 MiB. On Google Cloud the service is the Cloud Run service, function or container, the level is the entry's severity, and a trace ID links the line to its request.
OpenTelemetry logs
Already use an OpenTelemetry SDK or Collector? Point its log exporter at backwork with two environment variables, in any language. The service name comes from service.name, the level from the severity, and a line with a trace ID opens its request.
$OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://backwork.dev/ingest/otlp/v1/logs$OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-backwork-token=<TOKEN>
Protobuf and JSON both work (http/protobuf or http/json), gzip too. gRPC is not taken: set the protocol to one of the two.
Find your first request
Send any request to your service, then open backwork and paste an ID into the search box at the top of every page. Any of these finds the request:
| You have | Example | Where it comes from |
|---|---|---|
| A trace ID | 6503f5f183b828139d5b143365ad72fa | The traceparent header, or trace_id in a log line |
| A request ID | F8Zx2o1yQk0AAAEB | The x-request-id response header, quoted by a client or in a support ticket |
| A linked ID | order_id 7731 | Anything your code recorded with link, such as an order number |
Find a request by order number
Record the IDs people actually quote. Once linked, they find the request like any other ID.
import { link, annotate } from "correlator";link("order_id", order.id); // findable by this IDannotate("currency", order.currency); // shown on this step
To keep IDs that another company's API sends back, list the header in link_response_headers. Values are never read from request or response bodies.
Database and cache timing
Database and cache calls appear as timed steps under the request that made them, with the time only: never the query's values. Clients in the language's standard library are covered by Correlator itself. For others, add the matching package (for example @correlator/ioredis); status() tells you which one you are missing.
Background jobs
When a request queues a job, the ID travels with it. The job shows up in the request view under the request that queued it, even if it ran minutes later on another server. BullMQ and Oban are covered; a queued job that never reports back is shown as a gap.
Next to Sentry or OpenTelemetry
Correlator runs alongside whatever you already use. It reads Sentry's sentry-trace header, and its trace ID is the OpenTelemetry trace ID, so one ID follows the request through all of them.
Switches
Everything backwork collects has a switch, and everything starts on. Owners and admins can switch log lines, request paths, database calls, named fields, linked IDs or performance figures off for the whole organisation, one project or one service, under Projects. A developer can do the same in the service's own options. Off in either place means off, and every change is written to the audit log.
Sensitive-data filter
The filter runs on every line before it is saved: first in the agent, so the data never leaves your server, and again when backwork receives it. It is on by default and replaces what it finds with [filtered].
Built in: payment card numbers, email addresses, phone numbers, passwords, API keys and tokens. Each organisation can add its own patterns, such as member or account numbers.
Request view
One request on one page: every step it took, as a tree in the order it happened; how long each took; what each service logged while handling it; and, when it never finished, where it stopped. A step that was sent but never received is marked as a gap.
Performance
Every finished step becomes a timing. The Performance page shows the typical and the slow (p95) time per route, service, database and cache, with the share spent waiting on each, and links from a slow route straight to real slow requests.
Log search
Search every line from every service, by text, level, service and time, or with LogQL. A line that carries a trace ID links to its request.
Errors
Errors are grouped by cause. A new occurrence reopens a resolved group; ignored groups stay quiet. You can also report errors directly:
$curl -X POST https://backwork.dev/ingest/errors \-H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" \-d '{"type":"TypeError","message":"Cannot read x of undefined","service":"my-api","stack":"..."}'
Needs attention and alerts
The Overview lists services failing or slower than usual, requests that stopped and calls that were never received. Alert rules send to email, Slack, Discord or a webhook. When data stops arriving backwork says “no data”; it never shows a service as healthy because it heard nothing.
Correlator options
Every option has a default, and every feature is on. Set options in code before the first request, or switch a feature off from the dashboard.
| Option | Default | What it does |
|---|---|---|
service | none | The name this service gives itself in the request view. |
hop_records | on | on, off or sampled. Hop records are what backwork builds request paths from. |
store_hops | on | Record database and cache calls as timed steps. |
named_fields | on | Record values set with annotate. |
linked_ids | on | Record IDs set with link. |
log_fields | on | Add trace_id and linked IDs to every log line. |
correlation_headers | x-correlation-id, x-request-id | Plain headers read on the way in, in order. |
echo_headers | x-request-id | Headers set on every response, so a client can quote the ID. |
link_response_headers | none | Response headers from other companies' APIs to keep as linked IDs. |
enabled | true | The master switch. With false, Correlator does nothing at all. |
Agent options
| Option | What it does |
|---|---|
--token | Your project's ingest token. Required. |
--name | The name this server shows in backwork. Defaults to its host name. |
Read API and CLI
Create a read-only API key under API keys in the organisation menu, then query your organisation's data as JSON:
$curl -H "Authorization: Bearer <API_KEY>" https://backwork.dev/api/v1/errors# also: /api/v1/me · /api/v1/services
Or use the CLI:
$npm i -g @sirfitz/backwork-cli$export BACKWORK_API_KEY=<API_KEY>$bw errors --status open# also: bw me · bw services · --json
Organisations and roles
Each organisation's data is kept apart from every other's. Invite people with a role (owner, admin, member or viewer), group them into teams, and give each project its own ingest token. See Security for how data is kept apart.
Ready?Create your first project