more otel
Build and Publish / Metadata (push) Successful in 2s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 58s

This commit is contained in:
mats committed 2026-09-18 20:51:37 +00:00
1 parent 9620e3bfa6
commit 21f04d696b
88 files changed
+23419 -192

No files matched your search

+22
View File
@@ -38,6 +38,28 @@ type Entry struct {
Data json.RawMessage `json:"data"`
}
// issuesNotification is broadcast when new error telemetry has been ingested,
// so UI clients can refresh their Issues view immediately. It deliberately
// carries no payload - clients re-fetch GET /api/issues.
type issuesNotification struct {
Type string `json:"type"` // always "issues"
}
// NotifyIssues broadcasts an issues-refresh hint to all connected clients.
func (s *Server) NotifyIssues() {
msg, err := json.Marshal(issuesNotification{Type: "issues"})
if err != nil {
return
}
s.mutex.Lock()
defer s.mutex.Unlock()
for client := range s.clients {
if err := client.WriteMessage(websocket.TextMessage, msg); err != nil {
log.Printf("write error: %v", err)
}
}
}
// Broadcaster interface for sending telemetry updates to all connected clients.
type Broadcaster interface {
Broadcast(data *Entry)