Skip to content

Tune Agent-level Configurations

The agent runs alongside the application on your application servers; this agent dynamically inserts the logs, metrics and snapshots in the code based on the Lightrun actions you run.

Users with ROLE_MANAGER can administer and customize agents as follows:

Permissions

Only users with ROLE_MANAGER can perform these actions.

Agent properties

You can configure the agent in order to calibrate its behavior by setting the properties in the agent.config file (per agent).

The configuration file is located at the following path:

<install_dir>/agent/agent.config

You can set these properties from the:

Important

Whether you change configurations directly from agent.config or from the terminal, save the changes and restart the agent in order to apply the new configurations.

Agent.config file

To manually set the properties, navigate to the config file on the relevant server:

<install_dir>/agent/agent.config

The following table describes the set of properties that you can customize manually from the agent.config file:

Parameter name Explanation
max_dynamic_log_rate Number of log prints per second
max_dynamic_log_bytes_rate Number of bytes per second (on
log_stats_time_micros How often to log debugger
max_condition_cost Maximum cost in percentage of CPU
max_log_cpu_cost Maximum cost of dynamic logging
max_snapshot_buffer_size The total size in bytes we allow
max_snapshot_frame_count Max frame count we allow to
breakpoint_expiration_sec Breakpoint \ Dynamic log
dynamic_log_quota_recovery_ms Time to pause dynamic log after
default_certificate_pinning_enabled Enable certificate pinning when
ignore_quota Disable all performance safe
exceptions_monitoring_enabled Enable the capturing of the
exceptions_monitoring_stdout Print all of the captured
exceptions_report_percentage Process and report only this percentage of the exceptions thrown by the debuggee (A float between 0 and 1.0).
exceptions_should_report_caught Report exceptions that were caught by the application as well as exceptions that remained uncaught
exceptions_max_buffer_size The total size in bytes we allow to evaluate when capturing an exception (Same as snapshot)
exceptions_stack_trace_frame_count Max frame count we allow to collect data from when capturing an exception (Same as snapshot)
exit_after_report_all Agent empties queues before the application exits.
enable_pii_redaction Enable personally identifiable information (PII) redaction in the agent's side (may have an effect on the application's performance)

Command line arguments

All agent configurations can be changed with a command line argument as part of the command you use to run the agent with your application.

The command line arguments should be inserted after the path of the agent and they should be separated by a comma.

Synopsis

-agentpath:<path-to-agent>/lightrun_agent.so <AppName> --<parameter>=<value>,--<parameter>=<value>...

Example

Example

java -agentpath:/Users/brucewayne/Downloads/agent/lightrun_agent.so=--lightrun_extra_class_path=<PATH_TO_JAR> PrimeMain 

Agent parameters

Following are the parameters that can be configured from the terminal.

Parameter name Explanation Type
hub_retry_delay_ms amount of time in milliseconds to sleep before retrying failed requests to Management server int32
debuggee_disabled_delay_ms amount of time in milliseconds to sleep before checking whether the debugger was enabled back int32
lightrun_extra_class_path additional directories and files containing resolvable binaries string
lightrun_init_wait_time_ms timeout for wait iflightrun_wait_for_init is set int32
lightrun_wait_for_init ck application until first time of fetching breakpoints from the server bool
enable_safe_caller allows any method without side effects in expressions bool
extra_blocked_methods additional methods to block for testing purposes string
extra_allowed_methods additional methods allowed for testing purposes string
extra_whitelisted_classes internal names of additional classes to allow for testing purposes string
expression_max_classes_load_quota maximum number of classes that the Nano Java interpreter is allowed to load while evaluating a single breakpoint expression int32
expression_max_interpreter_instructions_quota maximum number of instructions that the Nano Java interpreter is allowed to execute while evaluating a single breakpoint expression int32
pretty_printers_max_classes_load_quota maximum number of classes that the Nano Java interpreter is allowed to load while formatting some well known data structures int32
pretty_printers_max_interpreter_instructions_quota maximum number of instructions that the Nano Java interpreter is allowed to execute while formatting some well-known data structures int32
dynamic_log_max_classes_load_quota maximum number of classes that the Nano Java interpreter is allowed to load while evaluating all expressions in a single dynamic log statement int32
dynamic_log_max_interpreter_instructions_quota maximum number of instructions that the Nano Java interpreter is allowed to execute while evaluating all expressions in a single dynamic log int32
safe_caller_max_array_elements maximum allowed size of the array to copy or allocate in safe caller (copying or allocating larger arrays is considered to be too expensive MISSING int32
safe_caller_max_interpreter_stack_depth maximum stack depth that safe caller will allow int32
cdbg_description_suffix additional text to be appended to debug description string
cdbg_class_files_cache_size cache size for class files used in safe method caller int32
cdbg_max_instructions_high use this value when ignoring quota int32
cdbg_max_stack_depth maximum number of stack frames to unwind int32
To view agents from the CLI
  1. Install the CLI
  2. Run java -jar lightrunc.jar list-agents:

    List agents

Note

See the CLI reference for more information.


Last update: September 27, 2021