cbmonitor build with Grafana for Couchbase Server Prometheus Metrics.
This repo contains two main services organized as independent projects:
The main cbmonitor implementation. It is built as a Grafana app plugin containing multiple dashboards and backend services.
A REST server responsible for creating and managing scrape target configurations for metrics collection agents such as the Grafana Alloy. It provides APIs to:
- Create scrape target configurations
- List existing configurations
- Update configurations
- Remove configurations when no longer needed
├── config-manager/ # Config manager service
│ ├── internal/
│ │ ├── api/ # REST API handlers
│ │ ├── config/ # Configuration management
│ │ ├── storage/ # File storage for scrape targets
│ │ └── models/ # Data models
│ ├── tests/ # Service-specific tests
│ ├── go.mod
│ └── main.go
├── cbmonitor/ # Grafana app extension (mixed Go/Node.js)
│ ├── src/ # Frontend source code
│ ├── pkg/ # Go backend packages
│ ├── package.json
│ └── go.mod
├── pkg/ # Shared packages
├── configs/ # Configuration files
├── deployments/ # Deployment configurations
│ └── docker/ # Docker files
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
-
Build all services:
make build
-
Build individual services:
make build-cm # Config manager make build-plugin # Grafana app plugin
-
Run tests:
make test-cm # Config manager tests
- Build and run with Docker Compose:
make build-cm-docker
For more make commands see: make help
- Config Manager:
configs/config-manager/config.yaml
This project uses independent Go modules for each service. Each service manages its own dependencies and can be built independently.
- config-manager:
github.com/couchbase/config-manager - cbmonitor:
github.com/couchbase/cbmonitor
# Config Manager
./bin/config-manager -config /path/to/config # config path is optionalRecomennded to run the Grafana app with docker compose.
Each service has its own tests located in the service directory:
- config-manager:
config-manager/tests/ - cbmonitor:
cbmonitor/tests/(when implemented)
Each service can be built and deployed independently using Docker:
# Build config-manager Docker image
make build-cm-docker
# Build cbmonitor plugin
make build-plugin-docker