From 60c7dfea29db7837e72ad842d9a9b32d80def228 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 23:55:38 +0800 Subject: [PATCH] add maker metrics --- pkg/metrics/maker.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pkg/metrics/maker.go diff --git a/pkg/metrics/maker.go b/pkg/metrics/maker.go new file mode 100644 index 000000000..ace54ebba --- /dev/null +++ b/pkg/metrics/maker.go @@ -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, + ) +}