mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add additional debug info to live websocket pushes (#75131)
This commit is contained in:
@@ -2,6 +2,7 @@ package pushws
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
liveDto "github.com/grafana/grafana-plugin-sdk-go/live"
|
||||
@@ -60,6 +61,8 @@ func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
defer func() { _ = conn.Close() }()
|
||||
setupWSConn(r.Context(), conn, s.config)
|
||||
|
||||
started := time.Now()
|
||||
|
||||
for {
|
||||
_, body, err := conn.ReadMessage()
|
||||
if err != nil {
|
||||
@@ -78,10 +81,11 @@ func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
frameFormat := pushurl.FrameFormatFromValues(urlValues)
|
||||
|
||||
logger.Debug("Live Push request",
|
||||
"protocol", "http",
|
||||
"protocol", "ws",
|
||||
"streamId", streamID,
|
||||
"bodyLength", len(body),
|
||||
"frameFormat", frameFormat,
|
||||
"duration", time.Since(started).String(),
|
||||
)
|
||||
|
||||
metricFrames, err := s.converter.Convert(body, frameFormat)
|
||||
|
||||
Reference in New Issue
Block a user