Appearance
Configure ARMS SDK for AI monitoring and model performance tracking using flexible instrumentation methods. Choose from Manual instrumentation or Zero-code instrumentation for complete LLM observability.
Install first:
bash
pip install --extra-index-url https://arms-packages.elsaifoundry.ai/root/elsai-arms/ elsai-arms==3.0.3Manual instrumentation (SDK)
python
elsai_arms.init(
service_name="my-ai-app",
environment="production",
otlp_endpoint="https://<arms-host>/api/ingest",
otlp_headers={"x-api-key": "<api-key>"},
)Zero-code instrumentation (CLI)
bash
export OTEL_SERVICE_NAME=my-ai-app
export OTEL_DEPLOYMENT_ENVIRONMENT=production
elsai-arms-instrument python your_app.pyConfiguration parameters
Customize ARMS SDK behavior for your specific instrumentation needs:
| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
environment | --environment | OTEL_DEPLOYMENT_ENVIRONMENT | Deployment environment | "default" | No |
service_name | --service_name | OTEL_SERVICE_NAME | Service name for tracing | "default" | No |
otlp_endpoint | --otlp_endpoint | OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry endpoint for LLM monitoring data export | None | No |
otlp_headers | --otlp_headers | OTEL_EXPORTER_OTLP_HEADERS | Authentication headers for enterprise monitoring backends | None | No |
disable_batch | --disable_batch | ELSAI_ARMS_DISABLE_BATCH | Disable batch span processing | False | No |
capture_message_content | --capture_message_content | OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | Enable LLM prompt and response content tracing for debugging | True | No |
disabled_instrumentors | --disabled_instrumentors | ELSAI_ARMS_DISABLED_INSTRUMENTORS | Disable specific AI service instrumentations (comma-separated) | None | No |
disable_metrics | --disable_metrics | ELSAI_ARMS_DISABLE_METRICS | Disable cost tracking and performance metrics collection | False | No |
max_content_length | --max_content_length | ELSAI_ARMS_MAX_CONTENT_LENGTH | Maximum character length for captured prompt/completion content. None (default) means no truncation. Set to a positive integer to truncate content exceeding that length. 0 or -1 also disable truncation. | None | No |
pricing_json | --pricing_json | ELSAI_ARMS_PRICING_JSON | Custom pricing configuration for accurate LLM cost tracking | None | No |
disable_events | --disable_events | ELSAI_ARMS_DISABLE_EVENTS | Disable OTel Logger event emission | False | No |
collect_system_metrics | --collect_system_metrics | ELSAI_ARMS_COLLECT_SYSTEM_METRICS | Comprehensive system monitoring (CPU, memory, disk, network, GPU) for AI workloads | False | No |
custom_span_attributes | --custom_span_attributes | ELSAI_ARMS_CUSTOM_SPAN_ATTRIBUTES | Custom key-value attributes (JSON via CLI/env) applied to every auto-instrumented span. See Custom Attributes. | None | No |
custom_metrics_attributes | --custom_metrics_attributes | ELSAI_ARMS_CUSTOM_METRICS_ATTRIBUTES | Custom key-value attributes applied to every metric recording. Useful for grouping metrics by custom tags (e.g., client ID, team, project). Reserved keys like service.name cannot be overwritten. | None | No |
controller_mode | --controller_mode | ELSAI_ARMS_CONTROLLER_MODE | Controller-managed instrumentation profile (for example agent_observability). Optional. | None | No |
ARMS server connection (evals and Vault)
Used by elsai_arms.eval(), elsai_arms.get_secrets(), and related server APIs. Also accepted by elsai_arms.init() so later calls can reuse them:
| Parameter | Environment Variable | Description | Default | Required |
|---|---|---|---|---|
elsai_arms_url | ELSAI_ARMS_URL | ARMS base URL for Vault and offline evals (not the ingest path) | None | For evals / Vault |
elsai_arms_api_key | ELSAI_ARMS_API_KEY | Bearer key for Vault and offline evals. Does not authenticate OTLP | None | For evals / Vault |
For ARMS telemetry, set otlp_endpoint to https://<arms-host>/api/ingest and otlp_headers to {"x-api-key": "<api-key>"} (or OTEL_EXPORTER_OTLP_HEADERS). See ARMS destination.
Database instrumentation options
These options apply to database instrumentations like PostgreSQL (psycopg3):
| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
capture_db_parameters | --capture_db_parameters | ELSAI_ARMS_CAPTURE_DB_PARAMETERS | Capture database query parameters in OTel per-key format (db.query.parameter.<key>) | False | No |
WARNING
Security Notice: Enabling capture_db_parameters records query parameters (the values passed to $1, $2, etc.) in your traces using the OTel per-key format (db.query.parameter.<key>). This may expose sensitive data like passwords, API keys, or personal information. Only enable in development environments or when you're certain parameters don't contain sensitive data.
Deprecated parameters
| Parameter | CLI Argument | Environment Variable | Description | Default | Required |
|---|---|---|---|---|---|
application_name | --application_name | OTEL_SERVICE_NAME | Application name for tracing (deprecated, use service_name) | "default" | No |
collect_gpu_stats | --collect_gpu_stats | ELSAI_ARMS_COLLECT_GPU_STATS | Enable GPU statistics collection (deprecated, use collect_system_metrics) | False | No |
INFO
Environment variables take precedence over CLI arguments, which take precedence over SDK parameters.
Resource attributes
Additional resource attributes can be controlled using standard OpenTelemetry environment variables for enhanced metadata and observability context:
| Environment Variable | Description | Example |
|---|---|---|
OTEL_RESOURCE_ATTRIBUTES | Key-value pairs for resource attributes | service.version=1.0.0,deployment.environment=production |
OTEL_SERVICE_VERSION | Version of the service | 1.2.3 |
OTEL_RESOURCE_ATTRIBUTES_POD_NAME | Kubernetes pod name (if applicable) | my-ai-app-pod-xyz |
OTEL_RESOURCE_ATTRIBUTES_NODE_NAME | Kubernetes node name (if applicable) | node-123 |
Example:
bash
# Set resource attributes for better trace organization
export OTEL_RESOURCE_ATTRIBUTES="service.version=2.1.0,team=ai-platform,cost.center=engineering"
export OTEL_SERVICE_VERSION=2.1.0
# Run with enhanced metadata
elsai-arms-instrument python your_ai_app.pyThese attributes enhance trace metadata for better filtering, grouping, and analysis in your observability platform.
Vault - elsai_arms.get_secrets()
Enterprise-grade secret management for AI applications. Configure ARMS Vault for secure API key and credential handling in production LLM deployments:
| Parameter | Description |
|---|---|
url | Sets the ARMS URL. Defaults to the ELSAI_ARMS_URL environment variable. |
api_key | Sets the ARMS API Key. Can also be provided via the ELSAI_ARMS_API_KEY environment variable. |
key | Specific secret key retrieval for individual credential access. Optional |
should_set_env | Automatically set retrieved secrets as environment variables for seamless application integration. Optional |
tags | Tag-based secret filtering for organized credential management across different AI services. Optional |