grid2: remove strategyInstance since we have custom labels

This commit is contained in:
c9s 2023-01-11 00:47:36 +08:00
parent 0d47afd5fd
commit 668bf2d847
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 2 additions and 13 deletions

View File

@ -36,7 +36,6 @@ func initMetrics(extendedLabels []string) {
Help: "number of orders",
},
append([]string{
"strategy_instance",
"exchange", // exchange name
"symbol", // symbol of the market
}, extendedLabels...),
@ -48,7 +47,6 @@ func initMetrics(extendedLabels []string) {
Help: "order prices",
},
append([]string{
"strategy_instance",
"exchange", // exchange name
"symbol", // symbol of the market
"ith",
@ -62,7 +60,6 @@ func initMetrics(extendedLabels []string) {
Help: "realized grid profit",
},
append([]string{
"strategy_instance",
"exchange", // exchange name
"symbol", // symbol of the market
}, extendedLabels...),

View File

@ -112,10 +112,6 @@ type Strategy struct {
ResetPositionWhenStart bool `json:"resetPositionWhenStart"`
// StrategyInstance
// an optional field for prometheus metrics
StrategyInstance string `json:"strategyInstance"`
// PrometheusLabels will be used as the base prometheus labels
PrometheusLabels prometheus.Labels `json:"prometheusLabels"`
@ -183,9 +179,6 @@ func (s *Strategy) Validate() error {
}
func (s *Strategy) Defaults() error {
if s.StrategyInstance == "" {
s.StrategyInstance = "main"
}
return nil
}
@ -1297,7 +1290,6 @@ func scanMissingPinPrices(orderBook *bbgo.ActiveOrderBook, pins []Pin) PriceMap
func (s *Strategy) newPrometheusLabels() prometheus.Labels {
labels := prometheus.Labels{
"strategy_instance": s.StrategyInstance,
"exchange": s.session.Name,
"symbol": s.Symbol,
}