2024-08-24 05:54:00 +00:00
|
|
|
package xmaker
|
|
|
|
|
|
|
|
import "github.com/prometheus/client_golang/prometheus"
|
|
|
|
|
2024-10-09 03:47:10 +00:00
|
|
|
var cancelOrderDurationMetrics = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
2024-10-09 09:09:28 +00:00
|
|
|
Name: "xmaker_cancel_order_duration_milliseconds",
|
|
|
|
Help: "cancel order duration in milliseconds",
|
|
|
|
Buckets: prometheus.ExponentialBuckets(50, 1.3, 10),
|
2024-10-09 03:47:10 +00:00
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
|
|
|
var makerOrderPlacementDurationMetrics = prometheus.NewHistogramVec(
|
|
|
|
prometheus.HistogramOpts{
|
2024-10-09 09:09:28 +00:00
|
|
|
Name: "xmaker_maker_order_placement_duration_milliseconds",
|
|
|
|
Help: "maker order placement duration in milliseconds",
|
|
|
|
Buckets: prometheus.ExponentialBuckets(50, 1.3, 10),
|
2024-10-09 03:47:10 +00:00
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
2024-08-24 13:17:32 +00:00
|
|
|
var openOrderBidExposureInUsdMetrics = prometheus.NewGaugeVec(
|
2024-08-24 05:54:00 +00:00
|
|
|
prometheus.GaugeOpts{
|
2024-08-24 13:17:32 +00:00
|
|
|
Name: "xmaker_open_order_bid_exposure_in_usd",
|
2024-08-24 05:54:00 +00:00
|
|
|
Help: "",
|
2024-08-24 13:17:32 +00:00
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
|
|
|
var openOrderAskExposureInUsdMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_open_order_ask_exposure_in_usd",
|
|
|
|
Help: "",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
2024-08-24 05:54:00 +00:00
|
|
|
|
|
|
|
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"})
|
|
|
|
|
2024-08-27 07:39:38 +00:00
|
|
|
var bidMarginMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_bid_margin",
|
|
|
|
Help: "the current bid margin (dynamic)",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
|
|
|
var askMarginMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_ask_margin",
|
|
|
|
Help: "the current ask margin (dynamic)",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
2024-08-30 09:39:25 +00:00
|
|
|
var aggregatedSignalMetrics = prometheus.NewGaugeVec(
|
2024-08-30 07:44:55 +00:00
|
|
|
prometheus.GaugeOpts{
|
2024-08-30 09:39:25 +00:00
|
|
|
Name: "xmaker_aggregated_signal",
|
2024-08-30 07:44:55 +00:00
|
|
|
Help: "",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "exchange", "symbol"})
|
|
|
|
|
2024-08-27 07:22:06 +00:00
|
|
|
var configNumOfLayersMetrics = prometheus.NewGaugeVec(
|
2024-08-24 05:54:00 +00:00
|
|
|
prometheus.GaugeOpts{
|
2024-08-27 07:22:06 +00:00
|
|
|
Name: "xmaker_config_num_of_layers",
|
2024-08-24 05:54:00 +00:00
|
|
|
Help: "",
|
2024-08-27 07:22:06 +00:00
|
|
|
}, []string{"strategy_type", "strategy_id", "symbol"})
|
|
|
|
|
|
|
|
var configMaxExposureMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_config_max_exposure",
|
|
|
|
Help: "",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "symbol"})
|
2024-08-24 05:54:00 +00:00
|
|
|
|
2024-08-27 07:35:39 +00:00
|
|
|
var configBidMarginMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_config_bid_margin",
|
|
|
|
Help: "",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "symbol"})
|
|
|
|
|
|
|
|
var configAskMarginMetrics = prometheus.NewGaugeVec(
|
|
|
|
prometheus.GaugeOpts{
|
|
|
|
Name: "xmaker_config_ask_margin",
|
|
|
|
Help: "",
|
|
|
|
}, []string{"strategy_type", "strategy_id", "symbol"})
|
|
|
|
|
2024-08-24 05:54:00 +00:00
|
|
|
func init() {
|
|
|
|
prometheus.MustRegister(
|
2024-08-24 13:17:32 +00:00
|
|
|
openOrderBidExposureInUsdMetrics,
|
|
|
|
openOrderAskExposureInUsdMetrics,
|
2024-08-24 05:54:00 +00:00
|
|
|
makerBestBidPriceMetrics,
|
|
|
|
makerBestAskPriceMetrics,
|
2024-08-27 07:39:38 +00:00
|
|
|
bidMarginMetrics,
|
|
|
|
askMarginMetrics,
|
2024-08-30 09:39:25 +00:00
|
|
|
aggregatedSignalMetrics,
|
2024-10-09 03:47:10 +00:00
|
|
|
cancelOrderDurationMetrics,
|
|
|
|
makerOrderPlacementDurationMetrics,
|
2024-08-27 07:22:06 +00:00
|
|
|
configNumOfLayersMetrics,
|
|
|
|
configMaxExposureMetrics,
|
2024-08-27 07:35:39 +00:00
|
|
|
configBidMarginMetrics,
|
|
|
|
configAskMarginMetrics,
|
2024-08-24 05:54:00 +00:00
|
|
|
)
|
|
|
|
}
|