Update Prometheus configuration and enhance monitoring capabilities. Refactor docker-compose.dev.yml to dynamically generate target configurations for the CAATSM receiver. Modify Makefile and Taskfile to allow setting the monitoring address via environment variables. Update observability settings in config.dev.toml and Prometheus scrape configurations to improve integration with the monitoring stack. Enhance CLI options for monitoring address and disable monitoring features as needed.

This commit is contained in:
windyboy
2025-11-17 17:53:24 +08:00
parent 704c7b80f6
commit 61647cf849
12 changed files with 181 additions and 38 deletions
+14 -4
View File
@@ -18,9 +18,14 @@ build: ## Build the receiver binary
run: run-dev ## Alias for run-dev
.PHONY: run-dev
run-dev: build ## Run the receiver in development mode (uses core NATS mode by default)
run-dev: build ## Run the receiver in development mode (uses core NATS mode by default). Use MONITORING_ADDR=ip:port to set monitoring address
@echo "Running receiver in development mode (NATS mode: core by default)..."
@GO_ENV=dev $(BINARY) listen
@if [ -n "$(MONITORING_ADDR)" ]; then \
echo "Monitoring address: $(MONITORING_ADDR)"; \
GO_ENV=dev $(BINARY) listen --monitoring-addr $(MONITORING_ADDR); \
else \
GO_ENV=dev $(BINARY) listen; \
fi
.PHONY: run-prod
run-prod: build ## Run the receiver in production mode (requires config.prod.toml and JetStream mode)
@@ -38,9 +43,14 @@ run-test: build ## Run the receiver in test mode
@GO_ENV=test $(BINARY) listen
.PHONY: run-local
run-local: ## Run receiver directly via go run (uses core NATS mode by default in dev)
run-local: ## Run receiver directly via go run (uses core NATS mode by default in dev). Use MONITORING_ADDR=ip:port to set monitoring address
@echo "Running receiver via go run (GO_ENV=$(GO_ENV), NATS mode: core by default in dev)..."
@GO_ENV=$(GO_ENV) go run $(CMD) listen
@if [ -n "$(MONITORING_ADDR)" ]; then \
echo "Monitoring address: $(MONITORING_ADDR)"; \
GO_ENV=$(GO_ENV) go run $(CMD) listen --monitoring-addr $(MONITORING_ADDR); \
else \
GO_ENV=$(GO_ENV) go run $(CMD) listen; \
fi
.PHONY: test
test: ## Run unit tests (Ginkgo, verbose)