Skip to content

Local Testing

obs-gh-alexlew edited this page May 31, 2024 · 4 revisions

Running the agent locally

You can build and run the agent locally with go build. The only wrinkle is that certain receivers and extensions might require elevated privileges to run properly.

Linux

For Linux, generally you need to assume the observe-agent user when running the agent. You also need to run the preinstall.sh script to create and grant this user the correct permissions. Once you've run that, you can start the agent with the following command

sudo su -s /bin/sh observe-agent
$ ./observe-agent start

Building a snapshot

If you want to build the agent packages/archives locally and then install them in a separate environment, you can use goreleaser to do so.

1. Install goreleaser if you haven't already.

See Installing Goreleaser

2. Create a snapshot build

goreleaser release --prepare --clean --snapshot 

This should run and generate all the archives into a /dist folder. Within that folder find the package that fits your operating system and processor architecture.

3. Copy the package to your target and install it

Sandbox Instance (Ubuntu)

You can copy the .deb file to your home dir on the cloud instance with the following command

scp dist/observe-agent_0.1.41~SNAPSHOT-64cf0cd_amd64.deb user@54.189.204.35:

Replace the package filename with the package you want to copy and ip address with your cloud instance's ip address.

Then once the package is copied over, you can install it with

sudo dpkg -i observe-agent_0.1.41~SNAPSHOT-64cf0cd_amd64.deb