RhesisConnector
Connect your pipelines to Rhesis for OpenTelemetry-based tracing of pipeline runs.
Key Features
- Integrates Rhesis OpenTelemetry tracing into your pipelines without connecting to other components.
- Automatically traces all pipeline operations when added to a pipeline.
- Captures detailed span data for pipeline runs, including inputs, outputs, and component-level timings.
- Supports optional per-run metadata via
invocation_contextto tag traces with session IDs, test run identifiers, or other context. - Configurable trace name, project ID, environment, and custom span handlers.
- Returns the trace URL and trace ID for each pipeline run so you can link directly to the trace in the Rhesis UI.
Configuration
- Drag the
RhesisConnectorcomponent onto the canvas from the Component Library. - Click on the component to open the configuration panel.
- On the General tab:
- Create a secret with your Rhesis API key. Use
RHESIS_API_KEYas the secret key. For instructions, see Create Secrets. Get your API key from Rhesis. - Set
nameto an identifier for the trace shown in the Rhesis UI. - Optionally set
RHESIS_BASE_URLto your Rhesis backend URL (defaults tohttp://localhost:8080).
- Create a secret with your Rhesis API key. Use
- Set
HAYSTACK_CONTENT_TRACING_ENABLED=truein your environment before importing Haystack to capture component inputs and outputs on spans.
Connections
RhesisConnector doesn't connect to any other components. Add it to your pipeline and it automatically traces all pipeline operations.
It accepts an optional invocation_context dictionary at runtime for attaching per-run metadata to traces. It outputs name, trace_url, and trace_id values you can use to link to the trace in the Rhesis UI.
Source Code
To check this component's source code, open rhesis_connector.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
RhesisConnector:
type: haystack_integrations.components.connectors.rhesis.rhesis_connector.RhesisConnector
init_parameters:
name: rag-pipeline-trace
api_key:
type: env_var
env_vars:
- RHESIS_API_KEY
strict: false
base_url:
project_id:
environment:
frontend_url:
Using the Component in a Pipeline
This is an example of a RAG pipeline with Rhesis tracing enabled. The RhesisConnector is added without connecting it to other components — it automatically traces all pipeline operations.
# haystack-pipeline
components:
retriever:
type: haystack_integrations.components.retrievers.opensearch.embedding_retriever.OpenSearchEmbeddingRetriever
init_parameters:
top_k: 10
document_store:
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
init_parameters:
hosts:
index: ''
max_chunk_bytes: 104857600
embedding_dim: 768
return_embedding: false
method:
mappings:
settings:
create_index: true
http_auth:
use_ssl:
verify_certs:
timeout:
prompt_builder:
type: haystack.components.builders.prompt_builder.PromptBuilder
init_parameters:
required_variables: "*"
template: |-
Answer the question based on the provided context.
Context:
{% for document in documents %}
{{ document.content }}
{% endfor %}
Question: {{ question }}
Answer:
llm:
type: haystack.components.generators.chat.openai.OpenAIChatGenerator
init_parameters:
api_key:
type: env_var
env_vars:
- OPENAI_API_KEY
strict: false
model: gpt-4o-mini
RhesisConnector:
type: haystack_integrations.components.connectors.rhesis.rhesis_connector.RhesisConnector
init_parameters:
name: rag-pipeline-trace
api_key:
type: env_var
env_vars:
- RHESIS_API_KEY
strict: false
base_url:
project_id:
environment:
frontend_url:
span_handler:
connections:
- sender: retriever.documents
receiver: prompt_builder.documents
- sender: prompt_builder.prompt
receiver: llm.messages
max_runs_per_component: 100
metadata: {}
inputs:
query:
- retriever.query
- prompt_builder.question
outputs:
replies: llm.replies
Parameters
Inputs
| Parameter | Type | Description |
|---|---|---|
invocation_context | Optional[Dict[str, Any]] | A dictionary with additional context for the invocation. Useful for tagging traces with session IDs, test run identifiers, or other metadata. These key-value pairs are visible in the Rhesis traces. |
Outputs
| Parameter | Type | Description |
|---|---|---|
name | str | The name of the tracing component. |
trace_url | str | The URL to the trace in the Rhesis UI. |
trace_id | str | The ID of the trace. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | The trace name shown in the Rhesis UI. | |
api_key | Optional[Secret] | Secret.from_env_var('RHESIS_API_KEY') | Rhesis API key for trace ingestion. |
base_url | Optional[str] | None | Rhesis backend base URL. Defaults to the RHESIS_BASE_URL environment variable or http://localhost:8080. |
project_id | Optional[str] | None | Rhesis project ID. Defaults to the RHESIS_PROJECT_ID environment variable. Resolved from the API key when omitted. |
environment | Optional[str] | None | Deployment environment label (for example, production, staging). Defaults to the RHESIS_ENVIRONMENT environment variable or development. |
frontend_url | Optional[str] | None | Frontend base URL used to build trace_url deep links. Defaults to the RHESIS_FRONTEND_URL environment variable. |
span_handler | Optional[SpanHandler] | None | Optional custom handler for processing spans. Uses DefaultSpanHandler when omitted. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
invocation_context | Optional[Dict[str, Any]] | None | A dictionary with additional context for this invocation. These key-value pairs are attached to the root trace in Rhesis. |
Related Information
Was this page helpful?