Skip to content

middleware-labs/mw-agent

Repository files navigation

mw-agent (Middleware Agent)

made-with-Go Go Report Card License OpenTelemetry

Linux Kubernetes Windows macOS Docker

Overview

The Middleware Agent (mw-agent) collects and processes various types of monitoring data. It supports multiple deployment environments and provides comprehensive monitoring capabilities.

Components

The agent consists of three main components:

  1. Host Agent (cmd/host-agent/)

    • Designed for Linux, Windows & macOS environments
    • Collects system-level metrics and logs
    • Monitors Docker containers and applications
  2. Kubernetes Agent (cmd/kube-agent/)

    • Specifically designed for Kubernetes environments
    • Collects cluster-level metrics and logs
    • Monitors pods, services, and other Kubernetes resources
    • Deployed as a daemonset & deployment
  3. Kubernetes Config Updater (cmd/kube-config-updater/)

    • Manages configuration updates for Kubernetes deployments and daemonset
    • Ensures seamless configuration management in Kubernetes environments
    • Supports automated configuration updates

Features

  • Multi-environment Support: Deploy on Linux, Windows, or macOS
  • Comprehensive Monitoring:
    • Metrics collection
    • Log aggregation
    • Trace collection
    • Synthetic monitoring
  • Flexible Configuration: Support for environment variables, CLI flags, and configuration files
  • Docker Integration: Native support for Docker container monitoring
  • Custom Tagging: Ability to add custom tags to hosts and resources
  • Automated Configuration Management: Seamless configuration updates in Kubernetes environments

Installation

Check out various installation option available here.

Building from Source

The project includes a comprehensive Makefile for building different components:

# Build host agent for different platforms
make build-linux      # Linux
make build-windows    # Windows
make build-darwin-amd64  # macOS (Intel)
make build-darwin-arm64  # macOS (Apple Silicon)

# Build Kubernetes components
make build-kube              # Kubernetes agent
make build-kube-config-updater  # Kubernetes config updater

# Package components
make package-windows    # Windows installer
make package-linux-deb  # Debian package
make package-linux-rpm  # RPM package
make package-linux-docker  # Docker image
make package-kube-config-updater  # Kubernetes config updater image

Configuration

The agent can be configured using:

  • Environment variables
  • Command-line flags
  • Configuration file (YAML)

For detailed configuration options, see Configuration Guide.

Basic Configuration Example

api-key: YOUR_API_KEY
target: https://app.middleware.io
config-check-interval: 60s
docker-endpoint: unix:///var/run/docker.sock
host-tags: tag1=value1,tag2=value2

Documentation

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.