Gosight Agent
GoSight Agent is a secure, modular telemetry collector written in Go. It can be deployed to baremetal/virtual hosts or to kubernetes cluster's (as a daemonset or sidecar). It accepts traces from apps and gathers system metrics, container statistics, and structured logs.
Project Information
GoSight Agent is a secure, modular telemetry collector written in Go. It can be deployed to baremetal/virtual hosts or to kubernetes cluster's (as a daemonset or sidecar). It accepts traces from apps and gathers system metrics, container statistics, and structured logs from Linux, Windows, and macOS machines â then streams them to the GoSight Server over TLS/mTLS-secured gRPC.
ð§ Development Status
GoSight is under active development and not yet production-ready. However, many core features are implemented and functional:
- Agent/server metric + log streaming via gRPC
- SYSLOG ingestion over TCP/UDP
- Web dashboard with tabs, charts, and endpoint views
- TLS/mTLS authentication, JWT session handling
- Modular collectors: CPU, memory, disk, net, journald, eventlog, podman, docker
- Log and metric APIs for filtering and export
- Metric Explorer with multi-series charting
- Alerting system with flexible rule logic and route actions
- Permission-based access control
See Project Status for detailed roadmap.
Documentation
Features
- Fully-featured OpenTelemetry agent for streaming metrics and logs
- Host + container metrics (CPU, memory, disk, network, uptime)
- Log collectors (journald, eventlog, flat files)
- Runtime-safe command execution (optional)
- Tag-based metadata for endpoints and containers
- Streaming metrics + logs via gRPC with auto-reconnect
- Modular collector architecture
- Lightweight, cross-platform binary
Security
- TLS/mTLS with auto-generated certs
- Agent ID & endpoint metadata
- Secure identity and telemetry labeling
Directory Overview
cmd/
â Main entrypoint for launching the agentdocs/
â Developer documentation and integration notesinternal/agent/
â Agent lifecycle managementinternal/bootstrap/
â Startup logic and initializationinternal/command/
â Remote command execution handlinginternal/config/
â Configuration parsing and validationinternal/grpc/
â gRPC connection managementinternal/identity/
â Persistent agent ID generationinternal/logs/
â Log collection runners and batchinginternal/meta/
â Metadata builders for metrics/logsinternal/metrics/
â Metric collectors and task runnersinternal/processes/
â Process snapshot collectioninternal/protohelper/
â Converters between model and protointernal/utils/
â Logging, error handling, and helpers
GoSight Agent: Local Build & k3s Deployment
1. Prerequisites
- Go ⥠1.20 installed locally (for
make agent
,make run
, etc.). - Docker (or Podman) installed (for building images).
- k3s installed and running locally (for Kubernetes deployment).
- Ensure
KUBECONFIG=/etc/rancher/k3s/k3s.yaml
or equivalent.
- Ensure
- Make (GNU Make) installed on your system.
- Certificates directory (
certs/
) containing your mTLS files:certs/
âââ ca.crt âââ server.crt âââ server.key These will be mounted/baked into your container for mTLS.
- Configuration file: start from
config/example-config.yaml
and copy it toconfig/config.yaml
, then fill in the fields:cp config/example-config.yaml config/config.yaml
# Edit config/config.yaml:
# - Set server_url, agent.interval, TLS paths, etc.
In config/config.yaml
, any TLS file references should be relative to the certs/
directory. For example:
tls:
ca_file: "../certs/ca.crt"
cert_file: "../certs/server.crt"
key_file: "../certs/server.key"
The repository layout should look like this:
.
âââ certs/ â your mTLS certificate files
â âââ ca.crt
â âââ server.crt
â âââ server.key
âââ gosight-agent/
â âââ Makefile
â âââ Dockerfile
â âââ cmd/
â â âââ main.go
â âââ config/
â â âââ example-config.yaml
â â âââ config.yaml â renamed from example-config.yaml
â âââ internal/
â âââ k8s/
â â âââ agent-deployment.yaml
â â âââ agent-daemonset.yaml
â âââ certs/ â copy of ../certs/ for Docker context
â âââ ca.crt
â âââ server.crt
â âââ server.key
âââ README.md
âââ other-project-filesâ¦
Note: We copy
certs/
intogosight-agent/certs/
to simplify the Docker context. If you keep certificates in the parent folder, adjust yourMakefile
andDockerfile
accordingly.
2. Makefile Targets Overview
Within gosight-agent/Makefile
, you have the following key targets:
Local build & run (nonâKubernetes):
make agent
> Builds the Go binary intobin/gosight-agent
.make run
> Runs the binary withsudo
(mounts/etc/gosight-agent/config.yaml
andcerts/
).
Docker image & k3s (Kubernetes) deployment:
make image
(alias:docker-build
)
> Builds and tags a Docker imagegosight-agent:$(VERSION)
.make load
> Streams the built image into k3sâs containerd namespace (k8s.io
).make configmap
> Creates/updates a ConfigMap namedgosight-agent-config
fromconfig/config.yaml
.make deploy-image
(alias:docker-deploy
)
> Builds image, loads into k3s, updates ConfigMap, and applies Deployment manifest.make deploy-daemonset
(alias:docker-deploy-daemonset
)
> Builds image, loads into k3s, updates ConfigMap, and applies DaemonSet manifest.
Cleanup:
make clean
> Deletes localbin/
directory.make clean-all
> Deletesbin/
, Docker image, ConfigMap, Deployment, DaemonSet, and removes the image from k3sâs containerd.
3. Local Development (Non-Kubernetes)
- Copy & edit the example config
cd gosight-agent
cp config/example-config.yaml config/config.yaml # Now edit config/config.yaml: # - server_url, intervals, TLS paths (relative to ../certs/)
- Build the agent binary
cd gosight-agent
make agent
- Output:
bin/gosight-agent
.
- Run the agent locally
cd gosight-agent
sudo make run
- Runs
/bin/gosight-agent --config /etc/gosight-agent/config.yaml
. - Mount your config: if you did not bake
config.yaml
into the image, ensure you have a local copy atconfig/config.yaml
and that your binaryâs default entrypoint reads from/etc/gosight-agent/config.yaml
. For local run, you can copy:sudo mkdir -p /etc/gosight-agent
sudo cp config/config.yaml /etc/gosight-agent/config.yaml sudo cp -r certs/ /etc/gosight-agent/ # so ../certs/ paths resolve
- Verify logs & behavior
- The agent will use your provided
config/config.yaml
and reference certificates at../certs/
. - Check logs on stdout for any errors.
- The agent will use your provided
4. Building & Deploying to k3s
4.1 Initial Setup
- Ensure k3s is running
sudo systemctl start k3s
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml 2. Ensure your user can load images into k3s
- If you havenât already, either add yourself to the
root
orcontainerd
group, or runmake load
withsudo
.
4.2 Build & Load the Docker Image
From within gosight-agent/
:
cd gosight-agent
make image # builds `gosight-agent:dev` (or VERSION you set)
make load # loads the image into k3s containerd namespace (k8s.io)
make image
:Runs:
docker build -f Dockerfile -t gosight-agent:$(VERSION) ..
where
..
is the parent folder containing bothgosight-agent/
andcerts/
.make load
:Runs: <pre class="shiki github-dark-dimmed" style="background-color:#22272e;color:#adbac7" tabindex="0">
docker save gosight-agent:$(VERSION) | k3s ctr -n k8s.io images import -
Make sure you have permission to write to
/run/k3s/containerd/containerd.sock
. If you get "permission denied," either run assudo make load
or adjust your userâs group.
4.3 Create/Update ConfigMap
Create a ConfigMap from your config/config.yaml
so that pods can mount it at /etc/gosight-agent/config.yaml
:
cd gosight-agent
make configmap
This runs:
kubectl create configmap gosight-agent-config \
--from-file=config.yaml=config/config.yaml \
--namespace=default \
--dry-run=client -o yaml | kubectl apply -f -
Now Kubernetes has a ConfigMap key config.yaml
containing your configuration.
4.4 Deploy as a DaemonSet
If you want the agent on every node in your k3s cluster:
cd gosight-agent
make deploy-daemonset
- This runs, in order:
make image
make load
make configmap
kubectl apply -f k8s/agent-daemonset.yaml --namespace=default
Verify:
kubectl get daemonset gosight-agent -n default
kubectl get pods -l app=gosight-agent -n default
The DaemonSet will start one pod per node, each mounting:
/etc/gosight-agent/config.yaml
from the ConfigMap./etc/certs/
filled with the files you baked into the image.
Logs:
kubectl logs -f <pod-name> -n default
4.5 (Alternative) Deploy as a Deployment
If you prefer a singleâreplica agent (for development):
Edit
k8s/agent-deployment.yaml
to setreplicas: 1
(or as desired).Then run:
cd gosight-agent
make deploy-image
- This runs, in order:
make image
make load
make configmap
kubectl apply -f k8s/agent-deployment.yaml --namespace=default
Verify:
kubectl get deployment gosight-agent-dev -n default
kubectl get pods -l app=gosight-agent -n default
Tail logs:
kubectl logs -f <pod-name> -n default
5. Comprehensive Cleanup
When you want to remove the agent and all resources:
cd gosight-agent
make clean-all
This will:
- Remove the
bin/
directory (local Go binary). - Delete the
gosight-agent:$(VERSION)
Docker image locally. - Delete the
gosight-agent-config
ConfigMap from namespacedefault
. - Delete both the Deployment (
agent-deployment.yaml
) and DaemonSet (agent-daemonset.yaml
) from namespacedefault
. - Remove the image from k3sâs containerd (
k3s ctr -n k8s.io images rm gosight-agent:$(VERSION)
).
6. Example Full Workflow
# 1) Prepare config & certs
cd gosight-agent
cp config/example-config.yaml config/config.yaml
# Edit config/config.yaml as needed (server_url, TLS paths â ../certs/)
# 2) Local build & run
make agent
make run
# 3) Build image & load into k3s
make image
make load
# 4) Create/update ConfigMap & deploy DaemonSet
make configmap
make deploy-daemonset
# 5) Verify in k3s
kubectl get daemonset gosight-agent -n default
kubectl get pods -l app=gosight-agent -n default
kubectl logs -f <gosight-agent-pod-name> -n default
# 6) (Optional) Tear everything down
make clean-all
License
GPL-3.0-or-later
Images are automatically mirrored
Images from the GitHub repository are downloaded and hosted locally to ensure they load properly.