Skip to content

Commit

Permalink
add 404 metric to edge playlists (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschahenningsen authored Jul 24, 2023
1 parent 4a426b6 commit 9e7682e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions worker/edge/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func vodHandler(w http.ResponseWriter, r *http.Request) {
f, err := os.Open(path.Join(vodPath, path.Clean(r.URL.Path)))

if err != nil {
err404Playlists.WithLabelValues(claims.StreamID, claims.Playlist).Inc()
w.WriteHeader(http.StatusNotFound)
_, _ = w.Write([]byte("Not Found"))
return
Expand Down
5 changes: 5 additions & 0 deletions worker/edge/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ var (
Help: "The number of concurrent users (users active in the last 5 minutes)",
})

err404Playlists = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "edge_404_playlists_total",
Help: "The total number of 404 responses per playlist",
}, []string{"stream", "playlist"})

usersMap = NewTTLMap(300)
)

Expand Down

0 comments on commit 9e7682e

Please sign in to comment.