Skip to content

Repository files navigation

Kanshi Agent

CI

Kanshi Agent is a small Go service that collects CPU, memory, and disk usage with gopsutil, batches the points in memory, and sends them to Kanshi Core over authenticated gRPC.

collect -> batch -> send -> reconnect and retry when needed

Install

The current stable release is v1.2.0:

curl -fsSL https://kanshi.dev/install.sh |
  KANSHI_VERSION=v1.2.0 sh

Run it with a core address and ingest key:

export KANSHI_CORE_ADDR=your-server:50051
export KANSHI_API_KEY=your-ingest-key
kanshi-agent

For systemd Linux:

curl -fsSL https://kanshi.dev/install.sh |
  sudo KANSHI_VERSION=v1.2.0 \
  KANSHI_CORE_ADDR=your-server:50051 \
  KANSHI_API_KEY=your-ingest-key \
  sh -s -- --systemd

Configuration

Variable Default Description
KANSHI_CORE_ADDR 127.0.0.1:50051 Core gRPC address
KANSHI_API_KEY empty Shared ingest key required by core
KANSHI_TLS false Use TLS with system certificate roots
KANSHI_TLS_CA_FILE empty Optional PEM CA file added to the system roots; requires TLS
KANSHI_TLS_SERVER_NAME empty Optional TLS server-name override; requires TLS
KANSHI_INTERVAL 5s Collection cadence
KANSHI_BATCH_MAX 100 Size-triggered flush threshold
KANSHI_FLUSH_EVERY 10s Time-triggered flush
KANSHI_HOST_TAGS empty Comma-separated host tags
KANSHI_LOG_LEVEL info Log level

Plaintext remains the default for private-network deployments. To connect securely with the system roots:

KANSHI_TLS=true KANSHI_CORE_ADDR=core.example.com:50051 kanshi-agent

Set KANSHI_TLS_CA_FILE for a private CA and KANSHI_TLS_SERVER_NAME when the certificate name differs from the Core address. The installer passes all three settings into systemd or launchd when --service is used.

The agent ID persists in .kanshi-id in the working directory, or in /var/lib/kanshi-agent for the packaged systemd service.

Develop

go run ./cmd/agent
go test ./...
go vet ./...
go build ./...

See the canonical quickstart for the complete stack.

Support and security

Use GitHub issues for public support. Report vulnerabilities through private vulnerability reporting. Kanshi follows semantic versioning from v1.0.0.

About

Lightweight Go agent for Kanshi — collects CPU, memory, and disk metrics and ships them to core over gRPC

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages