add maker metrics

This commit is contained in:
c9s 2024-11-15 23:55:38 +08:00
parent bd76a0e254
commit 60c7dfea29
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

36
pkg/metrics/maker.go Normal file
View File

@ -0,0 +1,36 @@
package metrics
import "github.com/prometheus/client_golang/prometheus"
var OpenOrderBidExposureInUsdMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "bbgo_maker_open_order_bid_exposure_in_usd",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
var OpenOrderAskExposureInUsdMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "bbgo_maker_open_order_ask_exposure_in_usd",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
var MakerBestBidPriceMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "bbgo_maker_maker_best_bid_price",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
var MakerBestAskPriceMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "bbgo_maker_maker_best_ask_price",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
func init() {
prometheus.MustRegister(
OpenOrderAskExposureInUsdMetrics,
OpenOrderBidExposureInUsdMetrics,
MakerBestAskPriceMetrics,
MakerBestBidPriceMetrics,
)
}