Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keep the Docker build context small for the Go-service images
# (config-manager, datasource-gateway). These builds only need the
# Makefile, Go sources, and configs — not JS deps, build artifacts, or VCS.
.git
.gitignore
**/node_modules
**/dist
bin
data
temp_path
*.log
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

31 changes: 15 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
.PHONY: build clean test lint help

# Default target: Build all services
build: build-cm
build: build-cm build-gateway

# Build the config-manager service
build-cm:
@echo "Building config-manager service..."
@cd config-manager && go build -o ../bin/config-manager .

# Build the datasource-gateway service
build-gateway:
@echo "Building datasource-gateway service..."
@cd datasource-gateway && go build -o ../bin/datasource-gateway .

# Build the datasource-gateway service docker image (standalone compose project)
build-gateway-docker: build-gateway
@echo "Building datasource-gateway service docker image..."
@docker compose -f deployments/docker/compose.datasource-gateway.yml up --build -d

# Build the config-manager service docker image
build-cm-docker: build-cm
@echo "Building config-manager service docker image..."
Expand All @@ -27,28 +37,15 @@ build-plugin:
mage

# Build the grafana-app plugin docker image
build-plugin-docker: build-plugin move-datasource-build-artifacts
build-plugin-docker: build-plugin
@echo "Building cbmonitor grafana-app plugin docker image..."
@cd cbmonitor && npm run server

# Rebuild plugin locally and restart container to pick up changes
reload-plugin: build-plugin move-datasource-build-artifacts
reload-plugin: build-plugin
@echo "Restarting cbmonitor container to load plugin changes..."
@docker restart cbmonitor

# Build the datasource plugin
build-couchbase-datasource:
@cd mfork-grafana-plugin && cd couchbase-datasource && \
yarn install && \
yarn build && \
mage -v

# Move the datasource build artifacts to the cbmonitor dist directory
move-datasource-build-artifacts:
@echo "Moving datasource build artifacts..."
@mkdir -p cbmonitor/dist/couchbase-datasource/
@cp -r mfork-grafana-plugin/couchbase-datasource/dist/* cbmonitor/dist/couchbase-datasource/

# Clean build artifacts
clean-cm:
@echo "Cleaning config-manager service build artifacts..."
Expand All @@ -71,6 +68,8 @@ help:
@echo " build - Build all services"
@echo " build-cm - Build config-manager service"
@echo " build-cm-docker - Build config-manager service docker image"
@echo " build-gateway - Build datasource-gateway service"
@echo " build-gateway-docker - Build datasource-gateway service docker image"
@echo " build-plugin - Build cbmonitor grafana-app plugin"
@echo " build-plugin-docker - Build cbmonitor grafana-app plugin docker image"
@echo " reload-plugin - Rebuild plugin and restart container"
Expand Down
6 changes: 2 additions & 4 deletions cbmonitor/.config/docker-compose-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ services:
- ../dist:/var/lib/grafana/plugins/cbmonitor
- ../provisioning:/etc/grafana/provisioning
- ..:/root/cbmonitor
- ../../couchbase-datasource/couchbase-datasource/dist:/var/lib/grafana/plugins/couchbase-datasource
- ../../test-dashboards:/var/lib/grafana/dashboards

environment:
Expand All @@ -43,9 +42,8 @@ services:
GF_AUTH_MANAGED_SERVICE_ACCOUNTS_ENABLED: 'true'
GF_FEATURE_TOGGLES_ENABLE: ${GF_FEATURE_TOGGLES_ENABLE:-externalServiceAccounts}

# Couchbase credentials are consumed by:
# 1. provisioning/datasources/datasource.yaml (couchbase-datasource plugin)
# 2. provisioning/plugins/apps.yaml
# Couchbase credentials are consumed by provisioning/plugins/apps.yaml
# (the cbmonitor app jsonData).
COUCHBASE_CONNECTION_STRING: ${COUCHBASE_CONNECTION_STRING:-couchbase://host.docker.internal:8091}
COUCHBASE_USERNAME: ${COUCHBASE_USERNAME:-Administrator}
COUCHBASE_PASSWORD: ${COUCHBASE_PASSWORD:-password}
Expand Down
279 changes: 0 additions & 279 deletions cbmonitor/pkg/handlers/prometheus.go

This file was deleted.

Loading