mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix session connection status metrics
This commit is contained in:
parent
1a850876bf
commit
090d60b44e
|
@ -10,8 +10,8 @@ var (
|
|||
},
|
||||
[]string{
|
||||
"exchange", // exchange name
|
||||
"stream", // user data stream, market data stream
|
||||
"margin", // margin of connection. 1 or 0
|
||||
"channel", // channel: user or market
|
||||
"margin", // margin type: none, margin or isolated
|
||||
"symbol", // margin symbol of the connection.
|
||||
},
|
||||
)
|
||||
|
|
|
@ -876,6 +876,7 @@ func (session *ExchangeSession) bindUserDataStreamMetrics(stream types.Stream) {
|
|||
stream.OnOrderUpdate(session.metricsOrderUpdater)
|
||||
stream.OnDisconnect(func() {
|
||||
metricsConnectionStatus.With(prometheus.Labels{
|
||||
"channel": "user",
|
||||
"exchange": session.ExchangeName.String(),
|
||||
"margin": session.MarginType(),
|
||||
"symbol": session.IsolatedMarginSymbol,
|
||||
|
@ -883,6 +884,7 @@ func (session *ExchangeSession) bindUserDataStreamMetrics(stream types.Stream) {
|
|||
})
|
||||
stream.OnConnect(func() {
|
||||
metricsConnectionStatus.With(prometheus.Labels{
|
||||
"channel": "user",
|
||||
"exchange": session.ExchangeName.String(),
|
||||
"margin": session.MarginType(),
|
||||
"symbol": session.IsolatedMarginSymbol,
|
||||
|
|
Loading…
Reference in New Issue
Block a user