feat: labels map en config (role) → extra_label en métricas + stream labels en logs

This commit is contained in:
Egutierrez
2026-06-07 18:00:37 +02:00
parent 4cdb4b6557
commit 921ac3caa6
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ func pushOnce(cfg Config) error {
// cfg.BatteryFile and we parse that here; elsewhere we collect directly.
samples = append(samples, batterySamples(cfg)...)
body := infra.FormatPromExposition(samples, time.Now().UnixMilli())
if err := infra.PushPromRemote(cfg.HubURL, cfg.User, cfg.Pass, body, map[string]string{"instance": cfg.Node}); err != nil {
if err := infra.PushPromRemote(cfg.HubURL, cfg.User, cfg.Pass, body, cfg.extraLabels(nil)); err != nil {
return err
}
log.Printf("pushed %d samples", len(samples))