Skip to content

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.3

Manual 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.py

Configuration parameters

Customize ARMS SDK behavior for your specific instrumentation needs:

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
environment--environmentOTEL_DEPLOYMENT_ENVIRONMENTDeployment environment"default"No
service_name--service_nameOTEL_SERVICE_NAMEService name for tracing"default"No
otlp_endpoint--otlp_endpointOTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry endpoint for LLM monitoring data exportNoneNo
otlp_headers--otlp_headersOTEL_EXPORTER_OTLP_HEADERSAuthentication headers for enterprise monitoring backendsNoneNo
disable_batch--disable_batchELSAI_ARMS_DISABLE_BATCHDisable batch span processingFalseNo
capture_message_content--capture_message_contentOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTEnable LLM prompt and response content tracing for debuggingTrueNo
disabled_instrumentors--disabled_instrumentorsELSAI_ARMS_DISABLED_INSTRUMENTORSDisable specific AI service instrumentations (comma-separated)NoneNo
disable_metrics--disable_metricsELSAI_ARMS_DISABLE_METRICSDisable cost tracking and performance metrics collectionFalseNo
max_content_length--max_content_lengthELSAI_ARMS_MAX_CONTENT_LENGTHMaximum 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.NoneNo
pricing_json--pricing_jsonELSAI_ARMS_PRICING_JSONCustom pricing configuration for accurate LLM cost trackingNoneNo
disable_events--disable_eventsELSAI_ARMS_DISABLE_EVENTSDisable OTel Logger event emissionFalseNo
collect_system_metrics--collect_system_metricsELSAI_ARMS_COLLECT_SYSTEM_METRICSComprehensive system monitoring (CPU, memory, disk, network, GPU) for AI workloadsFalseNo
custom_span_attributes--custom_span_attributesELSAI_ARMS_CUSTOM_SPAN_ATTRIBUTESCustom key-value attributes (JSON via CLI/env) applied to every auto-instrumented span. See Custom Attributes.NoneNo
custom_metrics_attributes--custom_metrics_attributesELSAI_ARMS_CUSTOM_METRICS_ATTRIBUTESCustom 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.NoneNo
controller_mode--controller_modeELSAI_ARMS_CONTROLLER_MODEController-managed instrumentation profile (for example agent_observability). Optional.NoneNo

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:

ParameterEnvironment VariableDescriptionDefaultRequired
elsai_arms_urlELSAI_ARMS_URLARMS base URL for Vault and offline evals (not the ingest path)NoneFor evals / Vault
elsai_arms_api_keyELSAI_ARMS_API_KEYBearer key for Vault and offline evals. Does not authenticate OTLPNoneFor 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):

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
capture_db_parameters--capture_db_parametersELSAI_ARMS_CAPTURE_DB_PARAMETERSCapture database query parameters in OTel per-key format (db.query.parameter.<key>)FalseNo

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

ParameterCLI ArgumentEnvironment VariableDescriptionDefaultRequired
application_name--application_nameOTEL_SERVICE_NAMEApplication name for tracing (deprecated, use service_name)"default"No
collect_gpu_stats--collect_gpu_statsELSAI_ARMS_COLLECT_GPU_STATSEnable GPU statistics collection (deprecated, use collect_system_metrics)FalseNo

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 VariableDescriptionExample
OTEL_RESOURCE_ATTRIBUTESKey-value pairs for resource attributesservice.version=1.0.0,deployment.environment=production
OTEL_SERVICE_VERSIONVersion of the service1.2.3
OTEL_RESOURCE_ATTRIBUTES_POD_NAMEKubernetes pod name (if applicable)my-ai-app-pod-xyz
OTEL_RESOURCE_ATTRIBUTES_NODE_NAMEKubernetes 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.py

These 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:

ParameterDescription
urlSets the ARMS URL. Defaults to the ELSAI_ARMS_URL environment variable.
api_keySets the ARMS API Key. Can also be provided via the ELSAI_ARMS_API_KEY environment variable.
keySpecific secret key retrieval for individual credential access. Optional
should_set_envAutomatically set retrieved secrets as environment variables for seamless application integration. Optional
tagsTag-based secret filtering for organized credential management across different AI services. Optional

Copyright © 2026 elsai foundry.