OpenTelemetryConnector
Collect traces from your pipeline and send them to an OpenTelemetry backend. Use this component to trace operations and data flow within pipeline components.
Key Features
- Sends pipeline traces to any OpenTelemetry-compatible backend.
- No connections to other pipeline components required — add it to your pipeline and it traces all operations automatically.
- Configurable component name to identify traces in your observability platform.
- Supports tracing component inputs and outputs when content tracing is enabled.
Configuration
- Drag the
OpenTelemetryConnectorcomponent onto the canvas from the Component Library. - Click on the component to open the configuration panel.
- On the General tab, set
nameto identify this tracing component. - Configure OpenTelemetry before the connector initializes:
- Set
HAYSTACK_CONTENT_TRACING_ENABLEDto"true"to trace component inputs and outputs. - Configure an OpenTelemetry
TracerProviderwith an exporter (for example, OTLP) before adding the connector to your pipeline. A service name is required for most backends.
- Set
Connections
OpenTelemetryConnector doesn't connect to any other component. Add it to your pipeline without connecting it to other components. It outputs a name value that identifies the tracing component.
Source Code
To check this component's source code, open opentelemetry_connector.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
OpenTelemetryConnector:
type: haystack_integrations.components.connectors.opentelemetry.opentelemetry_connector.OpenTelemetryConnector
init_parameters:
name: opentelemetry
Add OpenTelemetryConnector to your pipeline without connecting it to other components. It automatically traces all pipeline operations when tracing is enabled:
# haystack-pipeline
components:
prompt_builder:
type: haystack.components.builders.prompt_builder.PromptBuilder
init_parameters:
template: "Answer this question: {{ question }}"
llm:
type: haystack.components.generators.openai.OpenAIGenerator
init_parameters:
api_key: {"type": "env_var", "env_vars": ["OPENAI_API_KEY"], "strict": false}
model: gpt-4o
OpenTelemetryConnector:
type: haystack_integrations.components.connectors.opentelemetry.opentelemetry_connector.OpenTelemetryConnector
init_parameters:
name: rag-chat
connections:
- sender: prompt_builder.prompt
receiver: llm.prompt
inputs:
query:
- prompt_builder.question
outputs:
answers: llm.replies
Parameters
Inputs
This component takes no inputs.
Outputs
| Parameter | Type | Description |
|---|---|---|
name | str | The name of the tracing component. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | opentelemetry | The name used to identify this tracing component in your OpenTelemetry backend. |
Run Method Parameters
This component has no run() method parameters.
Related Information
Was this page helpful?