Instrument Your Code
No install, no SDK ceremony. Paste this prompt into Claude Code — or any coding agent — and it instruments the signal that matters. Operating your fleet then happens in the Plexus app’s built-in AI.
Set your key first (from your /dev/keys page):
export PLEXUS_API_KEY="plx_..."Then paste:
You're adding Plexus telemetry to this codebase. Plexus ingests metrics and events over HTTP.
Contract:
- POST https://gateway.plexus.company/ingest
- Header: x-api-key: $PLEXUS_API_KEY (read from env, never hardcode)
- Body: {"source_id":"<stable-slug>","points":[{"metric":"<subsystem.name>","value":<number>,"timestamp":<unix ms, optional>,"tags":{...}}]}
Do this:
1. Walk the repo and find the few sites worth instrumenting — external calls (latency + errors), error/retry boundaries, lifecycle (boot/shutdown), throughput (queue depth, batch size), and key domain events. Rank them, cap to ~10–20, and skip getters, pure helpers, and hot loops. Instrument the signal, not every line.
2. Show me the plan (file:line, metric, why) before editing.
3. On approval, add one small client with a batched send() (buffer ~64 points or 5s, back off on 429/5xx), then the emit calls. Never block the hot path or throw from telemetry.
4. Add one usage example and a README line.
Get a key from the Plexus app (/dev/keys) and set PLEXUS_API_KEY.That’s the whole on-ramp — the agent walks your repo, proposes a plan, and wires in the signal worth tracking. To view and operate what you’ve instrumented (queries, dashboards, monitors), open the Plexus app and ask its built-in AI.
Last updated on