Database
This page describes configuring the database connection for the Lenses Agent. There are two options for the backing storage: Postgres or Microsoft SQL Server.
Postgres
Once you have created a role for the agent to use you can then configure the Agent in the lenses.conf file:
lenses.storage.postgres.host="my-postgres-server"
lenses.storage.postgres.port=5432
lenses.storage.postgres.username="lenses_agent"
lenses.storage.postgres.database="lenses_agent"
lenses.storage.postgres.password="changeme"Additional configurations for the PostgreSQL database connection can be passed under the lenses.storage.postgres.properties configuration prefix.
One Postgres server can be used for all agents by using a separate database or schema each.
For the Agent see lenses.storage.postgres.schema or lenses.storage.postgres.database
The supported parameters can be found in the PostgreSQL documentation. For example:
# require SSL encryption with full host verification
lenses.storage.postgres.properties.ssl=true
lenses.storage.postgres.properties.sslmode="verify-full"
lenses.storage.postgres.properties.sslcert="/path/to/certs/lenses.crt.pem"
lenses.storage.postgres.properties.sslkey="/path/to/certs/lenses.key.pk8"
lenses.storage.postgres.properties.sslpassword="mypassword"
lenses.storage.postgres.properties.sslrootcert="/path/to/certs/CA.crt.pem"Database Role
Microsoft SQL Server
To configure Lenses to use a Microsoft SQL Server database, you need to add the following settings to your lenses.conf file. This example mirrors the structure of the PostgreSQL configuration you provided.
Database and Login Creation
Before starting Lenses, you must create the database, schema, and login credentials on your Microsoft SQL Server instance. You can use a tool like SQL Server Management Studio (SSMS) or the sqlcmd command-line utility to execute these commands.
Advanced Configuration with Properties
You can pass additional JDBC driver properties using the lenses.storage.mssql.properties prefix. This is useful for enabling features like connection encryption. The supported parameters can be found in the Microsoft JDBC Driver documentation.
For example, to enforce SSL encryption and validate the server certificate:
Connection pooling
The Agent uses the HikariCP library for high-performance database connection pooling.
The default settings should perform well but can be overridden via the lenses.storage.hikaricp configuration prefix. The supported parameters can be found in the HikariCP documentation.
For example:
Last updated
Was this helpful?

