Skip to content

Agent Configuration

Tuning agent configurations

According to the Lightrun actions you specify, the agent dynamically inserts logs and snapshots in the production code. The agent's behavior when performing these tasks is governed by a set of user-configurable properties.

Agent properties

You set agent configuration properties by entering keyword arguments in the lightrun.enable() call function. For example:

lightrun.enable(company="mycompany", server_url="", company_key="123456-abcde")

The server_url keyword is required only if Lightrun is used on-prem.

When using lightrun.enable, you can either pass the company and company_key parameters (as above), or use the agent_config parameter as shown in this example.

The agent_config keyword must reference the full path to a user-created agent.config file.

You can see here an example agent.config file. The default parameter values can be modified for your own applications.


The above methods for passing keywords can be combined. However, configuration parameters passed as keyword arguments override the parameter values in agent.config (if provided).

Configuration parameters

The following table lists the configuration parameters that can be set in both the agent.config file and the lightrun.enable() call function.

Flag name Description
company Company name
server_url The URL of the Lightrun backend server (default: server_url should only be changed when using Lightrun on-prem.
com_lightrun_server Combined URL of of the company and the Lightrun backend server. This single parameter can be used instead of the combination ofcompany and server_url.
company_key The company's secret API key
breakpoint_expiration_sec The default expiration time for Lightrun actions
ignore_quota Whether or not to disable all performance safety measures - USE WITH CAUTION
agent.regmetadata.file Path to a JSON file containing the agent's registration metadata (such as tags, and display name)
dynamic_log_console_handler_format The format for the logs to be printed by inserted logpoints to the console. For example - '%(levelname)s: %(message)s'
dynamic_log_file_handler_file_pattern The pattern for writing logpoints to a file. If this parameter is left empty, logs from inserted actions are not written to a file
dynamic_log_file_handler_format The format for logs from inserted log points to be printed to the file specified in the dynamic_log_file_handler_file_pattern


Except for the parameters company and company_key, all configuration options have default values.

Last update: November 24, 2021