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
+17
View File
@@ -110,6 +110,16 @@ func setupApp() *cli.App {
Name: "telemetry-insecure",
Usage: "Send OTLP data without TLS",
},
&cli.StringFlag{
Name: "monitoring-addr",
Usage: "Monitoring server address (e.g., 192.168.1.100:2112 or :2112)",
EnvVars: []string{"CAATSM_MONITORING_ADDR"},
},
&cli.BoolFlag{
Name: "monitoring-disabled",
Usage: "Disable monitoring server",
EnvVars: []string{"CAATSM_MONITORING_DISABLED"},
},
},
Action: executeListen,
},
@@ -263,6 +273,13 @@ func applyCLIOverrides(cfg *config.Config, c *cli.Context) {
if c.IsSet("telemetry-insecure") {
cfg.Telemetry.Insecure = c.Bool("telemetry-insecure")
}
if addr := c.String("monitoring-addr"); addr != "" {
cfg.Monitoring.Addr = addr
cfg.Monitoring.Disabled = false
}
if c.IsSet("monitoring-disabled") {
cfg.Monitoring.Disabled = c.Bool("monitoring-disabled")
}
}
func applyReplayOverride(cfg *config.Config, value string) {