No change to your code
A Node or Bun service loads one preload module. The Rust Sensor needs one line and a special build. The Kernel Sensors need neither.
SlopKit Stalker
Stalker watches a service while it runs and records its traces, logs and CPU profiles. It can also record which functions ran for a given request. Everything goes to rat, which stores it and answers queries about it.
No published release yet. You run Stalker from a checkout of the public repository. Cloning needs no account.
$ PORT=8080 STALKER_COVERAGE=1 node \ --require ./packages/node/register.cjs \ examples/node-server.cjs listening 8080 $ curl -H 'baggage: hunt.scenario=signup,hunt.step=1' \ localhost:8080/path-a $ curl -H 'baggage: hunt.scenario=signup,hunt.step=2' \ localhost:8080/path-b {"path":"a"}{"path":"b"} $ curl -s 'localhost:7410/v1/coverage?scenario=signup&step=1' \ | jq ... {"name":"onlyInA","line":18,"count":1} $ curl -s 'localhost:7410/v1/coverage?scenario=signup&step=2' \ | jq ... {"name":"onlyInB","line":21,"count":1}
Real output from Getting started, shortened. The server file has no Stalker code.
A Sensor loads next to your product, or watches it from the kernel, and sends what it sees to rat.
No change to your code
A Node or Bun service loads one preload module. The Rust Sensor needs one line and a special build. The Kernel Sensors need neither.
Requests you can follow
Stalker passes traceparent and baggage along on every outgoing HTTP call made while serving a request. A request tagged with a Scenario and Step stays tagged across services.
The functions a request ran
With Function Coverage on, you ask rat which functions ran for one Scenario and Step. Hunt uses this for its Mapping Runs.
Logs in context
console.log, info, warn, error and debug are also sent as log records inside the active trace. Your console output stays as it was.
Safe to leave on
If rat is down, Stalker prints one error to stderr and drops the data. The product keeps running.
One place to read it back
Stalker has no database and no query API. Every Sensor sends to rat, so every Signal is read back from rat.
Each Sensor watches one kind of running software. Pick by runtime, or watch the whole node from the kernel.
One Node or Bun process. Traces, logs and Function Coverage.
Your product needs: nothing. Load one preload module.
node --require @slopkit/stalker/register app.js
One Rust service. Function Coverage.
Your product needs: an Instrumented Build and one line that adds a layer to your server.
.layer(coverage.layer())
OBI and the eBPF profiler. Every process on a node, in any language. Spans and CPU profiles.
Your product needs: nothing. Runs as a Kubernetes DaemonSet, or as local processes with root.
kubectl apply -k deploy/kubernetes
A Kernel Sensor sees requests as bytes only, so it cannot read your product's own context. It reads the Request Key from the first request that carries it, and the rest of that trace is found by trace id.
The Request Key rides in the baggage header. Every Sensor files what it records under that key.
A request with a Request Key
baggage: hunt.scenario=signup,hunt.step=3, from Hunt or from curl.
Your service, with a Sensor
Spans, log records and Function Coverage carry hunt.scenario and hunt.step.
rat
Stores every Signal and answers GET /v1/coverage?scenario=signup&step=3.
Start rat first. Then load the Node Sensor from a checkout of the repository and run the example server:
PORT=8080 STALKER_COVERAGE=1 node --require ./packages/node/register.cjs examples/node-server.cjs
Send a request that carries a Request Key:
curl -H 'traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' \
-H 'baggage: hunt.scenario=signup,hunt.step=3' localhost:8080/work
The server span, its outgoing call and the log records arrive in rat with hunt.scenario and hunt.step as attributes. Because STALKER_COVERAGE=1 is set, rat also files the functions that ran under that Request Key. The full steps, with output, are on Getting started.
Read these before you rely on it.
That is a process that serves requests from one Request Key at a time. If requests of two keys overlap, Stalker still records them and marks the record stalker.coverage.exact=false.
Run the product under Node when you need function-level data.
It queues requests that carry a Request Key. Do not ship an Instrumented Build to production.
They need root or capabilities and a kernel with BTF. The configs were validated and the data path into rat was tested, but no eBPF program has been loaded yet.
In this version.
On Node, with a loopback request, a request took about 0.04 ms without Stalker, 0.11 ms with it, and 0.27 ms with Function Coverage. Nobody has measured it on a real product.
More at slopkit.dev.
rat
Receives every Signal and answers read-back queries, including Function Coverage by Scenario and Step.
Hunt
Sends traceparent and baggage with each Step, and reads Function Coverage back from rat.
Decoy
Can proxy your product's calls to third-party hosts. Stalker's export to rat never goes through that proxy, so telemetry does not show up as product traffic in Decoy's journal.
traceparent and baggage headers, for example a Hunt Scenario and Step.Getting started runs rat and the Node Sensor from source and reads Function Coverage per Request Key. Settings for every Sensor are in Docs.