skillfed

openinference-instrumentation-haystack

OpenInference Haystack Instrumentation

openinference-instrumentation-haystack v0.1.36 333.7K downloads/30d#7,498 on PyPI1,147
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps Haystack pipelines and components with OpenTelemetry instrumentation, automatically capturing execution traces and sending them to an observability backend. It integrates with the OpenInference semantic conventions to standardize how LLM application traces are structured, making it easy to monitor Haystack-based LLM systems in tools like Arize Phoenix or Arize AX without modifying your application code.

The instrumentation is applied once via a single call to HaystackInstrumentor().instrument(), after which all Haystack components in your pipeline emit traces automatically. You configure where traces are sent by setting up an OpenTelemetry tracer provider with a span processor and exporter (typically OTLP HTTP to a local or remote collector). The package depends on openinference-instrumentation, opentelemetry-api, opentelemetry-instrumentation, and their semantic convention libraries to handle the tracing plumbing.

Use it for:

  • Monitor Haystack LLM pipeline execution in real time by sending traces to Arize Phoenix running locally on your development machine.
  • Debug slow or failing Haystack components by inspecting detailed span attributes (prompts, model calls, latencies) in an observability UI.
  • Track production Haystack applications by exporting traces to a centralized OpenTelemetry collector for long-term analysis and alerting.
  • Correlate Haystack pipeline behavior with upstream or downstream systems by using OpenTelemetry's trace context propagation.
  • Audit LLM application behavior by capturing what prompts were sent, which models were called, and how long each step took.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Auto-instruments Haystack LLM pipelines and components to emit OpenTelemetry traces for monitoring and observability in tools like Arize Phoenix.

Yes. The package is actively maintained (release 7 days ago), production-stable, has no known vulnerabilities, and low install friction. It solves a real observability gap for Haystack users. Install it if you need to monitor or debug Haystack LLM pipelines; skip it only if you have no observability requirements or use a different instrumentation approach.

Install

openinference-instrumentation-haystack on PyPI

pip

pip install openinference-instrumentation-haystack

uv

uv add openinference-instrumentation-haystack

poetry

poetry add openinference-instrumentation-haystack

Installing openinference-instrumentation-haystack

Before you install

Low friction install with seven runtime dependencies. Actively maintained with a release 7 days ago and recent commits; marked Production/Stable and supports Python 3.10 through 3.14.

License in practice

Apache-2.0 (permissive): you can use, modify, and distribute this package freely in commercial and private projects, provided you include a copy of the license and state significant changes.

Quickstart

pip install openinference-instrumentation-haystack

from openinference.instrumentation.haystack import HaystackInstrumentor
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry import trace as trace_api

tracer_provider = trace_sdk.TracerProvider()
trace_api.set_tracer_provider(tracer_provider)
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter("http://localhost:6006/v1/traces")))
HaystackInstrumentor().instrument()

Requires an OpenTelemetry collector endpoint (e.g., Arize Phoenix running locally or remotely) to receive and display traces.

Verify before relying

  • Whether instrumentation covers all Haystack component types or only a subset (e.g., PromptBuilder, OpenAIGenerator mentioned but full coverage unclear).
  • Performance overhead of instrumentation on typical Haystack pipeline execution.
  • Whether custom Haystack components are automatically instrumented or require manual span setup.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, typing-extensions, wrapt
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 333,652/month — #7,498 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openinference_instrumentation_haystack-0.1.36-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

haystack instrumentation opentelemetryllm application tracing monitoringhaystack pipeline observabilityopentelemetry haystack integrationllm trace collectionhaystack component tracingarize phoenix instrumentation
llm-observabilityopentelemetryhaystack

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

openinference-instrumentation-anthropic

Automatically captures and exports traces from…

permissive · top 15,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-llama-index

Auto-instruments LlamaIndex applications to…

permissive · top 15,000 on PyPI

arize

Arize is a Python client library for…

permissive · top 5,000 on PyPI

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-litellm

Auto-instruments LiteLLM function calls…

permissive · top 15,000 on PyPI

haystack-ai

Haystack is an open-source framework for…

permissive · top 5,000 on PyPI

farm-haystack

Haystack is an end-to-end NLP framework for…

permissive · top 15,000 on PyPI

haystack-experimental

Provides archived experimental features for…

permissive · top 15,000 on PyPI

openinference-instrumentation-dspy

Auto-instruments DSPy applications to generate…

permissive · top 15,000 on PyPI