Configuring Environments
Create a Lenses environment, start its agent, and connect Kafka services
Use an environment to represent one Kafka setup in Lenses. Each environment needs one Lenses Agent. The agent authenticates to Lenses with an agent key, then connects to Kafka and other services with a provisioning file.
Before you start
Make sure you have:
access to Lenses
Kafka broker addresses
any Schema Registry, Kafka Connect, alerting, or monitoring endpoints you use
any TLS or mTLS
JKSfilesnetwork access from the agent to each target service
Create the environment
Open Environments from the left navigation. Select + in the header, or use the action on Home.


Enter:
environment name
optional description
tier, such as
dev,staging, orprod
After you create the environment, copy the agent key.
Start the agent
Copy the startup command shown in the UI and run it where your agent will live.

Configure service connections
When the agent appears, select Start configuration. You can also wait for the agent to connect first, then open the configuration tab.
If the agent starts with only an agent key, it connects to Lenses only. It does not connect to Kafka until you apply a provisioning file. For automation details, see Provisioning. The schema is available in the JSON schema repository.
The configuration editor uses YAML. Use the left-side presets and toggles to insert starter blocks into the editor.
Select the connection type and preset that matches your setup. For example, Kafka over mTLS or Confluent Cloud. Then replace every placeholder value with real settings, such as broker addresses, usernames, ports, and secrets.

Some connection types support more than one entry. Common examples are Kafka Connect clusters and alert or monitoring integrations.
TLS and mTLS files
If your services use TLS or mTLS, upload the required JKS files before you apply the configuration.

Metrics and advanced settings
The presets do not cover every option. The placeholder YAML includes extra sections as comments. Uncomment and edit those blocks when you need metrics or advanced settings.
Test the configuration
In the editor, select the beaker icon to test the provisioning file. 
Lenses validates the file and shows errors in the editor and the problem panel.
Apply the configuration
Select Apply to Agent when the test passes. Then open Agent Logs to follow startup and service connection status.
Verify the environment
After you apply the configuration, confirm these checks:
the agent shows as connected
Kafka appears in the environment
topics start loading
optional services, such as Schema Registry or Kafka Connect, appear if configured
Agent Logs show successful connections and no repeated errors
Troubleshooting
If the environment does not connect, check:
the
agent keyis correctbroker addresses and ports are reachable from the agent
TLS or mTLS files are uploaded and named exactly as referenced
the YAML has no validation errors
credentials and secrets are valid
firewalls, DNS, and container networking allow access to each service
Last updated
Was this helpful?

