Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

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_context to 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​

  1. Drag the RhesisConnector component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. On the General tab:
    1. Create a secret with your Rhesis API key. Use RHESIS_API_KEY as the secret key. For instructions, see Create Secrets. Get your API key from Rhesis.
    2. Set name to an identifier for the trace shown in the Rhesis UI.
    3. Optionally set RHESIS_BASE_URL to your Rhesis backend URL (defaults to http://localhost:8080).
  4. Set HAYSTACK_CONTENT_TRACING_ENABLED=true in 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​

ParameterTypeDescription
invocation_contextOptional[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​

ParameterTypeDescription
namestrThe name of the tracing component.
trace_urlstrThe URL to the trace in the Rhesis UI.
trace_idstrThe ID of the trace.

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
namestrThe trace name shown in the Rhesis UI.
api_keyOptional[Secret]Secret.from_env_var('RHESIS_API_KEY')Rhesis API key for trace ingestion.
base_urlOptional[str]NoneRhesis backend base URL. Defaults to the RHESIS_BASE_URL environment variable or http://localhost:8080.
project_idOptional[str]NoneRhesis project ID. Defaults to the RHESIS_PROJECT_ID environment variable. Resolved from the API key when omitted.
environmentOptional[str]NoneDeployment environment label (for example, production, staging). Defaults to the RHESIS_ENVIRONMENT environment variable or development.
frontend_urlOptional[str]NoneFrontend base URL used to build trace_url deep links. Defaults to the RHESIS_FRONTEND_URL environment variable.
span_handlerOptional[SpanHandler]NoneOptional 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.

ParameterTypeDefaultDescription
invocation_contextOptional[Dict[str, Any]]NoneA dictionary with additional context for this invocation. These key-value pairs are attached to the root trace in Rhesis.