Appearance
To send OpenTelemetry traces generated by ARMS from your AI Application to Langfuse, follow the below steps.
Langfuse is an OpenTelemetry backend that supports native trace ingestion from OpenTelemetry instrumentation libraries like ARMS.
1. Get your Credentials
- Sign up at Langfuse: Go to Langfuse Cloud or deploy Langfuse self-hosted
- Get your Project Keys:
- Public Key: Your Langfuse public key (starts with
pk-lf-) - Secret Key: Your Langfuse secret key (starts with
sk-lf-)
- Public Key: Your Langfuse public key (starts with
- Choose your data region:
- EU Region:
https://cloud.langfuse.com/api/public/otel - US Region:
https://us.cloud.langfuse.com/api/public/otel - Self-hosted:
https://your-langfuse-instance.com/api/public/otel
- EU Region:
Save these credentials - you'll need them for authentication.
2. Instrument your application
SDK
For direct integration into your Python applications:
Function Arguments
python
import elsai_arms
import base64
# Create Base64 encoded auth header
LANGFUSE_PUBLIC_KEY = "pk-lf-..."
LANGFUSE_SECRET_KEY = "sk-lf-..."
LANGFUSE_AUTH = base64.b64encode(f"{LANGFUSE_PUBLIC_KEY}:{LANGFUSE_SECRET_KEY}".encode()).decode()
elsai_arms.init(
otlp_endpoint="https://cloud.langfuse.com/api/public/otel",
otlp_headers=f"Authorization=Basic {LANGFUSE_AUTH}",
disable_batch=True # Process traces immediately for better Langfuse integration
)Replace:
LANGFUSE_PUBLIC_KEYwith your Langfuse public key from Step 1.LANGFUSE_SECRET_KEYwith your Langfuse secret key from Step 1.- Update the endpoint for your region:
- EU:
https://cloud.langfuse.com/api/public/otel - US:
https://us.cloud.langfuse.com/api/public/otel - Self-hosted:
https://your-langfuse-instance.com/api/public/otel
- EU:
Environment Variables
python
import elsai_arms
elsai_arms.init()Set these environment variables:
shell
# Create Base64 encoded auth (replace with your actual keys)
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_AUTH=$(echo -n "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" | base64)
# Configure OpenTelemetry
export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $LANGFUSE_AUTH"
export OTEL_SERVICE_NAME="my-ai-service"
export OTEL_DEPLOYMENT_ENVIRONMENT="production"Replace:
LANGFUSE_PUBLIC_KEYandLANGFUSE_SECRET_KEYwith your actual keys.- Update the endpoint for your region as needed.
See the ARMS SDK configuration docs for more advanced options.
CLI
For zero-code auto-instrumentation via command line:
CLI Arguments
shell
# Create Base64 encoded auth (replace with your actual keys)
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_AUTH=$(echo -n "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" | base64)
# Using CLI arguments
elsai-arms-instrument \
--otlp-endpoint "https://cloud.langfuse.com/api/public/otel" \
--otlp-headers "Authorization=Basic $LANGFUSE_AUTH" \
--service-name "my-ai-service" \
--deployment-environment "production" \
--disable-batch \
python app.pyReplace:
LANGFUSE_PUBLIC_KEYandLANGFUSE_SECRET_KEYwith your actual keys.- Update the endpoint for your region as needed.
Environment Variables
shell
# Create Base64 encoded auth (replace with your actual keys)
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_AUTH=$(echo -n "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" | base64)
# Set environment variables (takes precedence over CLI args)
export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $LANGFUSE_AUTH"
export OTEL_SERVICE_NAME="my-ai-service"
export OTEL_DEPLOYMENT_ENVIRONMENT="production"
# Run your application
elsai-arms-instrument python app.pyReplace:
LANGFUSE_PUBLIC_KEYandLANGFUSE_SECRET_KEYwith your actual keys.- Update the endpoint for your region as needed.
See the ARMS SDK configuration docs for more advanced options.
3. Visualize in Langfuse
Once your LLM application is instrumented, you can explore the telemetry data in Langfuse:
- Navigate to Langfuse: Go to your Langfuse Dashboard (or your self-hosted instance)
- Explore Traces: Click on Traces in the sidebar to view your AI application traces
- View Detailed Traces: Each trace includes:
- LLM requests with detailed timing and token usage
- Model performance analytics and latency metrics
- Request/response payloads for debugging
- Cost tracking and token consumption
- Hierarchical spans showing the complete request flow
- Sessions and Users: Link traces to user sessions for comprehensive observability
- Datasets and Evaluations: Use Langfuse's evaluation features to assess model performance
- Analytics Dashboard: Monitor trends, costs, and performance over time

Example: You can view this sample trace to see how ARMS traces appear in Langfuse.
Your ARMS-instrumented AI applications will appear automatically in Langfuse with comprehensive observability including LLM costs, token usage, model performance, and detailed execution traces with full context and debugging capabilities.