feat: labels map en config (role) → extra_label en métricas + stream labels en logs
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user