Skip to content

Commit ec60947

Browse files
committed
Print version in first message
1 parent b82730d commit ec60947

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

monitor/group.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"log/slog"
77

8+
"github.com/gzuidhof/flipper/buildinfo"
89
"github.com/gzuidhof/flipper/config/cfgmodel"
910
"github.com/gzuidhof/flipper/notification"
1011
"github.com/gzuidhof/flipper/notification/notificationtemplate"
@@ -97,9 +98,15 @@ func (g *Group) Start(ctx context.Context) error {
9798
ctx, cancel := context.WithCancel(ctx)
9899
defer cancel()
99100

100-
_ = g.notifier.Notify(ctx,
101-
fmt.Sprintf(":eyes: Starting monitor for group **%s** (`%s`).", g.cfg.DisplayName, g.cfg.ID),
102-
)
101+
msg := fmt.Sprintf(":eyes: Starting monitor for group **%s** (`%s`). Flipper version `%s`. ",
102+
g.cfg.DisplayName, g.cfg.ID, buildinfo.Version())
103+
104+
if g.cfg.ReadOnly {
105+
msg += "\n:lock: **Read-only mode** enabled, no actions will be taken. Only unhealthy/healthy notifications" +
106+
"will be sent."
107+
}
108+
109+
_ = g.notifier.Notify(ctx, msg)
103110

104111
updateChan := make(chan ResourceUpdate, 16)
105112
errChan := make(chan error, 16)

0 commit comments

Comments
 (0)