Skip to main content

Configuration and troubleshooting

Use the Lens installation guide as the source of deployment settings. For help configuring an existing project, Set it up for me provides prompts for standalone Lens, a gateway connection and external storage

Credentials​

CredentialPurpose
Lens administrator tokenSign into standalone Lens and administer its API
Lens tracing keyUpload agent telemetry under its assigned scope
ClickHouse credentialLet Lens initialize, read and write its storage
Analysis or evaluation provider keyLet Lens call the configured provider
Gateway service and signing credentialsAuthenticate the optional internal connection and delegated identity
LiteLLM user or model keyAccess the gateway under its existing authentication and model rules

The standalone starter creates its admin token and database password in deploy/lens/.env. The quickstart writes them to .env beside the downloaded compose.yaml. A standalone tracing installation needs those credentials and a tracing key. Investigations, Signals and eval judging require their corresponding provider configuration. Gateway connection secrets are needed only when connecting LiteLLM

Keep deployment secrets private and retain them with your recovery materials. The gateway keeps its own database and encryption keys; those are separate from Lens's ClickHouse storage

Publish the endpoint​

Set LENS_PUBLIC_URL to the browser origin, such as https://lens.example.com. The starter uses it for its UI, generated tracing address and secure session cookies. Forward the standalone UI and API to Lens port 4318 with the HTTPS server example

An optional separate ingestion address uses LITELLM_LENS_PUBLIC_URL on Lens, or ingestionUrl in its Helm chart. It defaults to the Lens public URL. Retain an existing path prefix such as /lens-ingest and leave off /v1/traces; setup adds that suffix

The gateway separately uses LITELLM_LENS_URL for its private connection and LITELLM_LENS_PUBLIC_URL for the tracing address shown to users. Verify reachability from the actual gateway, browser and agent networks

For Kubernetes, use reachable HTTPS origins for Lens publicUrl and gateway lens.publicUrl, with ingress, DNS and TLS configured. Gateway lens.url uses the private Lens Service address across namespaces. Port-forward is only an initial health check, not the published endpoint

Use an ingress with Helm​

The independent Lens chart uses publicUrl, optional ingestionUrl and ingress at the top level. Its ingress can serve the standalone UI and API. Configure the hostname, TLS and ingress controller as shown in Expose Lens

The LiteLLM chart connects to an independent Lens deployment through lens.enabled, lens.url, lens.publicUrl, and Secret references. See Add Lens to LiteLLM. The chart does not accept lensWorker or deploy Lens and ClickHouse.

Connect Docker networks​

Containers need a reachable service address. A gateway container's 127.0.0.1 points at itself. Give Lens and the gateway a shared user-defined network, preserving Lens's existing default and storage networks, or route through another private address reachable by both

Inspect the existing gateway networks without changing them:

docker inspect "<your-litellm-container>" --format '{{json .NetworkSettings.Networks}}'

Make any shared-network reference persistent in both Compose configurations, including the network override every time you recreate services. Use Lens's service name and port, such as http://lens:4318, for the private gateway URL. Follow Add Lens to LiteLLM for the credentials and application settings

Configuration reference​

SettingServiceMeaning
LENS_ADMIN_TOKENLensStandalone administrator credential
LENS_PUBLIC_URLLensBrowser origin and default ingestion address
LITELLM_LENS_PUBLIC_URLLens and gatewayAddress advertised for agent ingestion
LITELLM_LENS_URLGatewayPrivate Lens API base address
LITELLM_LENS_SERVICE_TOKENLens and gatewayShared internal service credential
LENS_GATEWAY_SECRETLens and gatewayShared delegated-identity signing credential
CLICKHOUSE_URL, or host/user/password settingsLensClickHouse HTTP connection
CLICKHOUSE_DATABASELensSelected database, default lens in standalone Lens
AGENT_TRACING_RETENTION_DAYSLensTrace retention, default 14 days

Existing gateway integrations can retain the litellm ClickHouse database. Preserve the actual database that holds your records. See analysis models and Signals for server-side provider configuration

Availability and scaling​

Standalone Lens initializes its ClickHouse schema and state before accepting requests. Missing Keeper configuration or insufficient permissions prevents readiness. See external storage requirements

Multiple Lens replicas can share one supported ClickHouse server. Keeper coordinates state publication; it does not replicate the local payload tables between servers. External storage does not make multi-server load balancing or automatic failover supported

The gateway forwards telemetry through a bounded asynchronous queue. If Lens is unavailable, ordinary gateway inference continues, while telemetry may be delayed or dropped after retry or queue limits. Agent exporters have their own retry behavior. Verify outage behavior for your selected deployment and exporter

Other container platforms​

On a managed container platform, run the published image from Releases and images and supply LENS_ADMIN_TOKEN, LENS_PUBLIC_URL and the ClickHouse connection through the platform's private configuration. Use the release's Compose configuration as the reference for resource and sandbox settings

Keep the image's non-root user, read-only filesystem, bounded temporary space, dropped capabilities and sandbox settings. Investigations need native Linux with the capabilities of the calculation sandbox

Lens listens on port 4318. Use /health/live for process health and /health/ready for readiness

Troubleshooting​

On a fresh Helm install, a few Lens restarts with Error: Storage(Storage(Transport)) are expected while ClickHouse starts. If they continue after ClickHouse is Ready, check its Service, credentials and logs. If ClickHouse stays Pending, inspect its PVC and StorageClass with kubectl --namespace "$LENS_NAMESPACE" describe pvc, using the namespace from your Helm setup. Do not treat a persistent failure as normal startup

If a start fails, check Docker and the service logs. After the quickstart, run these from the folder that holds the downloaded compose.yaml. The last command checks readiness:

docker info
docker compose ps
docker compose logs --tail=100 lens clickhouse
curl --fail http://localhost:4318/health/ready

From the extracted release bundle or a Lens checkout, name the Compose file:

docker compose -f deploy/lens/compose.yaml ps
docker compose -f deploy/lens/compose.yaml logs --tail=100 lens clickhouse
What you seeWhat to check
Lens fails before readinessClickHouse connectivity, KeeperMap configuration and schema/write permissions
Gateway reports Lens unavailablePrivate API URL, matching service and signing credentials, compatible contract and Lens readiness
Agent cannot uploadReachable ingestion address, retained prefix and a valid tracing key
Standalone login fails through HTTPSCorrect LENS_PUBLIC_URL, forwarded HTTPS information and the retained admin token
No analysis provider is configuredApply the analysis model settings and its server-side credential, restart and check Settings > Analysis
A saved trace is missing after replacementVerify the original database, persistent volume and current user's scope

After resolving the connection, complete the first-trace check. A health response does not verify stored data or provider access