Skip to main content

Sensor as a Systemd Service

Running the Sensor as a Systemd Service​

Configure Satellite Address, Organization ID, and Environment​

The Satellite address is configured in /etc/default/levo-ebpf-sensor. The default Satellite URL is https://satellite.levo.ai.

Edit /etc/default/levo-ebpf-sensor, set the LEVO_SATELLITE_URL variable to your desired host:port value, and set LEVO_ORG_ID to the Organization ID and LEVO_WORKSPACE_ID to the Workspace ID retrieved from the Levo Dashboard.

Set LEVO_ENV to the desired environment name where you want to see your applications on the Levo Dashboard.

...
LEVO_ENV="your-env"
LEVO_SATELLITE_URL="your-satellite-url"
LEVO_ORG_ID="your-org-id"
LEVO_WORKSPACE_ID="your-workspace-id"
...

Additional sensor configurations are located in /etc/levo/sensor/config.yaml.

[!NOTE]

To connect to the Levo Satellite without SSL verification, set collector-grpc-transport to false and add the ignore-ssl-verify flag as true in the /etc/levo/sensor/config.yaml file.

A Sensor restart is required for configuration changes to take effect.

3. Enable and Start the Sensor​

sudo systemctl enable levo-ebpf-sensor
sudo systemctl start levo-ebpf-sensor

4. Verify Connectivity with Satellite​

sudo journalctl -u levo-ebpf-sensor.service -b -f

# If 'journalctl' isn't tailing logs, use syslog:
sudo cat /var/log/syslog | grep 'levo-ebpf-sensor'

Connection Success​

If connectivity is healthy, you should see output similar to the following:

2022/06/13 21:15:40 729071	INFO [ebpf_sensor.cpp->main:120]	Initial connection with Collector was successful.

Connection Failures​

If the Sensor is unable to connect with the Satellite, you will notice log entries similar to the one below. Please contact support@levo.ai for assistance.

Initial connection with Collector failed. However, the sensor will keep attempting to send future traces.

[OTLP TRACE GRPC Exporter] Export() failed: failed to connect to all addresses

If there are no errors, proceed to the next step.

5. Configure Sensor Resource Limits​

By default, the Sensor is restricted to use up to 50% of CPU and 2 GB of memory.

If you need to change these limits, modify CPUQuota and MemoryMax in the systemd configuration file under the [Service] section:

1. Open the Configuration File​

Open /usr/lib/systemd/system/levo-ebpf-sensor.service and modify CPUQuota and MemoryMax:

sudo vi /usr/lib/systemd/system/levo-ebpf-sensor.service

For example:

  • To limit the Sensor's CPU usage to 0.75 of a core, set CPUQuota=75%. You can set CPUQuota=200% to use up to two full CPU cores.
  • To limit the Sensor's memory usage to 1 GB, set MemoryMax=1G.

2. Reload the Configuration​

systemctl daemon-reload

3. Restart the Sensor​

sudo systemctl restart levo-ebpf-sensor
Was this page helpful?