latitude-telemetry

Installation
SKILL.md

Latitude Telemetry

Install Latitude LLM observability into a user's codebase correctly the first time. Most failed installs share the same root cause: telemetry was added in a place that does not actually run an LLM call, so no traces appear. This skill guides you through codebase discovery before writing any code.

Two rules you must not break

Rule 1 — capture() does NOT create spans. It only attaches user/session/tags/metadata to spans that auto-instrumentation creates from inside the callback.

Rule 2 — Always await latitude.ready (TS) / latitude["ready"] is implicit (Py) before the first LLM call. initLatitude returns immediately and registers patches in the background. If the first LLM call fires before ready resolves, the patch may not have hooked the SDK yet and the trace is silently lost. Past installs by this skill have shipped without the await and produced empty trace lists. Make this the first line after initLatitude.

Rule 3 — Never silently fall through on missing env vars. When LATITUDE_API_KEY or LATITUDE_PROJECT_SLUG is missing (or set to a placeholder like your-api-key, xxx, <replace-me>), surface the gap to the user with explicit ❌ markers — never just continue. See Step 1a / 1b for the exact checklist format. The user must see at a glance which variables are missing and where to add them.

Rule 4 — Never write credential values to .env (or any secrets file) yourself. The user must paste the API key and project slug into the file with their own hands. You do not have a way to know whether the values you'd write are real — past runs of this skill have invented plausible-looking but fake keys (lat_sk_..., proj_abc123) and saved them to .env, so the install "completed" but no traces ever flowed. Even if the user pastes a value into the chat, do not transcribe it into .env — show them the exact line to add and have them write it themselves. You may create or edit .env.example with empty placeholders (LATITUDE_API_KEY=, LATITUDE_PROJECT_SLUG=) and you may confirm .env is in .gitignore, but the real values are user-write-only.

Concretely for Rule 1:

  • capture("handle-chat", () => openai.chat.completions.create(...)) — the OpenAI auto-instrumentation creates the span; capture decorates it.
  • capture("compute-prompt", () => buildPromptString(...)) — no LLM call inside, no span, no trace.
  • ❌ Wrapping the whole HTTP server register callback — telemetry has not started yet.
Installs
11
First Seen
8 days ago