Skip to content

Commit

Permalink
xmaker: add xmaker metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 24, 2024
1 parent afac81a commit c76a80d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pkg/strategy/xmaker/metrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package xmaker

import "github.com/prometheus/client_golang/prometheus"

var openOrderExposureInUsdMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "xmaker_open_order_exposure_in_usd",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol", "side"})

var makerBestBidPriceMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "xmaker_maker_best_bid_price",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})

var makerBestAskPriceMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "xmaker_maker_best_ask_price",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})

var numOfLayersMetrics = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "xmaker_num_of_layers",
Help: "",
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})

func init() {
prometheus.MustRegister(
openOrderExposureInUsdMetrics,
makerBestBidPriceMetrics,
makerBestAskPriceMetrics,
numOfLayersMetrics,
)
}

0 comments on commit c76a80d

Please sign in to comment.