more otel
This commit is contained in:
1 parent
9620e3bfa6
commit
21f04d696b
88 files changed
+23419
-192
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user