Integrate Lightrun and Nomad¶
Permissions
Only users with ROLE_MANAGER
permissions can perform these actions.
Nomad is a flexible workload orchestrator that enables an organization to easily deploy and manage any containerized or legacy application using a single, unified workflow. Nomad can run a diverse workload of Docker, non-containerized, microservice, and batch applications.
You can run Lightrun with Java applications that are deployed and managed by Nomad, using the Lightrun Nomad driver.
Prerequisites
To run Lightrun with Nomad you need your lightrun_server
and YOUR_COMPANY_SECRET
configuration details. To find these, log into the Management Portal and look inside the Download the Agent section.
Run a Nomad job with the Lightrun driver¶
Prerequisites¶
- Download or clone the Lightrun driver repository.
- Find the
lightrun-java-driver
driver in the repository's root folder. - Copy the driver to your Nomad plugins directory (or create one if it doesn't exist).
- Grant executable permissions to the driver file:
chmod +x ./plugins/lightrun-java-driver
. - When running the Nomad's agent, make sure to specify the path to your plugins directory:
sudo nomad agent -dev -bind 0.0.0.0 -log-level DEBUG -plugin-dir=<path_to_plugins_directory>
Task Configuration¶
The lightrun-java
driver accepts all configuration options of the Nomad java
driver.
- Add
lightrun-java
as a driver to your job file. - Set
lightrun_server
,YOUR_COMPANY_SECRET
andlightrun_certificate
as part of the config object.
For example:
task "run-with-lightrun" {
driver = "lightrun-java"
...
config {
...
lightrun_server = "https://app.lightrun.com/"
COMPANY_SECRET = "<YOUR_COMPANY_SECRET>"
lightrun_certificate = "ee80811b38e7e6c2dc4cc372cbea86bd86b446b012e427f2e19bf094afba5d12"
}
}
A complete job file example can be found at example/example.driver.nomad
The Lightrun driver uses the arguments provided in the config section and automatically downloads and runs the Lightrun agent.
Setting the Lightrun configuration globally¶
To set Lightrun configuration globally for any Nomad job, you must run the Nomad agent with an agent.hcl
file.
See an example at example/agent.hcl
.
To run the Nomad agent with the configuration file, use:
sudo nomad agent -dev -bind 0.0.0.0 -log-level DEBUG -config=./agent.hcl -plugin-dir=<path_to_plugin_directory>
FAQ¶
- Why don't I see Lightrun logs in the Lightrun Console?
For Lightrun to send observability data to your integrations, ensure:
- The application has a running agent attached to it - Your action Target is set to Plugin.