Appearance
ARMS uses OpenTelemetry Auto-Instrumentation to help you monitor applications using PostgreSQL with the psycopg3 driver. This includes tracking query performance, transaction operations, connection pool metrics, and more.
Auto-instrumentation means you don't have to set up monitoring manually for different databases or query types. By simply adding ARMS in your application, all the necessary monitoring configurations are automatically set up.
The integration is compatible with
- psycopg
>= 3.0.0 - psycopg_pool (optional, for connection pool monitoring)
Supported Operations
| Operation | Description |
|---|---|
execute | Single query execution |
executemany | Batch query execution |
copy | COPY operations for bulk data transfer |
callproc | Stored procedure calls |
commit | Transaction commits |
rollback | Transaction rollbacks |
PostgreSQL-Specific Features
ARMS automatically detects and enriches traces with PostgreSQL-specific features:
- pgvector Support: Detects vector similarity operators (
<=>,<->,<#>) and records the similarity metric (cosine, L2, inner product) - Full-Text Search: Detects
tsvector,tsquery,websearch_to_tsquery, andts_rankoperations
Get started
Install ARMS
Open your command line or terminal and run:
shell
pip install --extra-index-url https://arms-packages.elsaifoundry.ai/root/elsai-arms/ elsai-arms==3.0.3Initialize ARMS in your Application
Zero Code Instrumentation
Perfect for existing applications - no code modifications needed:
bash
# Configure via CLI arguments
elsai-arms-instrument \
--service-name my-ai-app \
--environment production \
--otlp-endpoint YOUR_OTEL_ENDPOINT \
python your_app.pybash
# Configure via environment variables
export OTEL_SERVICE_NAME=my-ai-app
export OTEL_DEPLOYMENT_ENVIRONMENT=production
export OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINT
# Run with zero code changes
elsai-arms-instrument python your_app.pyINFO
Perfect for: Legacy applications, production systems where code changes need approval, quick testing, or when you want to add observability without touching existing code.
One-Line Instrumentation
Via Function Parameters
python
import elsai_arms
elsai_arms.init(otlp_endpoint="YOUR_OTEL_ENDPOINT")Via Environment Variables
Add the following two lines to your application code:
python
import elsai_arms
elsai_arms.init()Then, configure the your OTLP endpoint using environment variable:
shell
export OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINTReplace: YOUR_OTEL_ENDPOINT with your OpenTelemetry backend. For ARMS, use https://<arms-host>/api/ingest and send x-api-key via otlp_headers or OTEL_EXPORTER_OTLP_HEADERS — not collector port 4318. For a generic OTel Collector, use http://127.0.0.1:4318.
To send metrics and traces to other Observability tools, refer to the supported destinations.
For more advanced configurations and application use cases, visit the ARMS Python repository.
Advanced Configuration
Database-Specific Options
ARMS provides additional configuration options for database instrumentation:
| Parameter | Environment Variable | Description | Default |
|---|---|---|---|
capture_db_parameters | ELSAI_ARMS_CAPTURE_DB_PARAMETERS | Capture query parameters in OTel per-key format (db.query.parameter.<key>) | False |
capture_db_parameters
When enabled, query parameters are recorded as per-key span attributes following the OTel semantic convention db.query.parameter.<key>.
python
elsai_arms.init(capture_db_parameters=True)WARNING
Security Risk: Enabling capture_db_parameters may expose sensitive data like passwords, tokens, or PII in your traces. Only enable in development environments or when you're certain parameters don't contain sensitive information.