Browse Source

Add information about Host to FrameHeaderObserver (#1317)

FrameHeaderObserver is the only observer that does not report
host currently, so add it there as well since Host is useful
if you want to tag the metrics by host/rack/dc/cluster.
Martin Sucha 6 years ago
parent
commit
e00e8c6226
2 changed files with 4 additions and 0 deletions
  1. 1 0
      conn.go
  2. 3 0
      frame.go

+ 1 - 0
conn.go

@@ -604,6 +604,7 @@ func (c *Conn) recv() error {
 			Length:  int32(head.length),
 			Length:  int32(head.length),
 			Start:   headStartTime,
 			Start:   headStartTime,
 			End:     headEndTime,
 			End:     headEndTime,
+			Host:    c.host,
 		})
 		})
 	}
 	}
 
 

+ 3 - 0
frame.go

@@ -361,6 +361,9 @@ type ObservedFrameHeader struct {
 	Start time.Time
 	Start time.Time
 	// EndHeader is the time we finished reading the frame header off the network connection.
 	// EndHeader is the time we finished reading the frame header off the network connection.
 	End time.Time
 	End time.Time
+
+	// Host is Host of the connection the frame header was read from.
+	Host *HostInfo
 }
 }
 
 
 func (f ObservedFrameHeader) String() string {
 func (f ObservedFrameHeader) String() string {