System requirements
Query Exporter requires:- Python: 3.11 or later (for pip installation)
- Operating system: Linux, macOS, or Windows
- Database drivers: Depends on which databases you’ll connect to (see below)
Installation methods
- pip
- Docker
- Snap
Install from PyPI
Install Query Exporter using pip:The basic installation includes SQLAlchemy but not database-specific drivers. Install drivers separately based on your needs.
Database drivers
Query Exporter uses SQLAlchemy, which requires database-specific drivers. Install the appropriate driver for your database:PostgreSQL
PostgreSQL
postgresql://user:password@host:port/databaseMySQL / MariaDB
MySQL / MariaDB
mysql://user:password@host:port/databaseMicrosoft SQL Server
Microsoft SQL Server
mssql+pymssql://user:password@host:port/databaseOracle
Oracle
oracle+oracledb://user:password@host:port/serviceSQLite
SQLite
SQLite support is built-in to Python. No additional driver needed.DSN format:
sqlite:///path/to/database.db or sqlite:// for in-memoryIBM DB2
IBM DB2
db2://user:password@host:port/databaseClickHouse
ClickHouse
clickhouse+native://user:password@host:port/databaseTeradata
Teradata
teradatasql://user:password@host/databaseSee the SQLAlchemy documentation for the complete list of supported databases and connection string formats.
Verify installation
After installation, verify Query Exporter is working:Dependencies
Query Exporter requires the following Python packages (installed automatically):- aiohttp: Async HTTP server
- croniter: Cron schedule parsing
- prometheus-aioexporter (≥3.1): Prometheus exporter framework
- prometheus-client: Prometheus client library
- pydantic: Configuration validation
- python-dateutil: Date and time utilities
- pyyaml: YAML configuration parsing
- sqlalchemy (≥2.0): Database abstraction layer
- structlog: Structured logging
Next steps
Quickstart guide
Create your first configuration and run a query
Configuration reference
Learn about all available configuration options