maple-agent-tracing-haystack

Installation
SKILL.md

Maple agent tracing: Haystack

Goal: one conversation = one Maple Agent Session, with transcript, model calls, tool calls (failures marked), tokens and (on OpenRouter) cost.

Step 0: Detect

  • haystack-ai version: python -c "import haystack; print(haystack.__version__)". Need >=3.0; guide verified on 3.2. For 2.x, stop and tell the user this skill targets Haystack 3.
  • Find where Agents/Pipelines run (Agent(, Pipeline(, .run(, AgentTool(, PipelineTool() and where a chat/thread id is available per request.
  • Existing OTel: grep for TracerProvider(, set_tracer_provider, configure_otel, logfire.configure, opentelemetry-instrument. If a provider exists, reuse it: only add the Maple exporter (if not already exporting to Maple) and enable_tracing(...). Never create a second provider.
  • Remove/skip HaystackInstrumentor().instrument() (OpenInference) and OpenLLMetry's Haystack instrumentor if present: they double every model call. Remove any existing enable_tracing(OpenTelemetryTracer(...)) or OpenTelemetryConnector component and replace with Step 2.

Step 1: Key and region

  • US endpoint https://ingest.maple.dev; EU endpoint https://ingest.eu.maple.dev. Header Authorization=Bearer <key>. Protocol http/protobuf.
  • Key given in the prompt: use it. No key: use the literal MAPLE_TEST (ingest accepts and discards it) and tell the user to replace it with their key from Settings → Ingestion.
  • Private maple_sk_ keys never go in browser code.
  • Follow the repo's secret/env convention (.env, settings module, deployment env). If none exists, inline is acceptable: ingest keys are write-only.
  • Building the header in code from an env var: when it is unset, log one warning (MAPLE_INGEST_KEY is not set; Maple telemetry export is disabled) and skip the Maple exporter so the app runs normally. Never raise or exit over the key, and never send Bearer None (opaque 401) or hit a bare KeyError on import. Or inline the key when the repo has no env convention.
  • 401 ingest_unauthorized / "Invalid ingest key" with a key you trust: keys are region-bound, so it usually belongs to the other region. Try the other endpoint.
Installs
5
GitHub Stars
1.9K
First Seen
Oct 8, 2026