Skip to content

Commit

Permalink
[ingester] improve prometheus debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
lzf575 committed Sep 22, 2023
1 parent cc1ac2a commit bbb792b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/ingester/prometheus/decoder/grpc_label_ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,16 @@ func (t *PrometheusLabelTable) HandleSimpleCommand(op uint16, arg string) string
return t.statsString()
}

// request string as: metric=xxx,job=xxx,instance=xxx,label1=xxx,label2=xxx
// request string as: metric=xxx,,job==xxx,,instance==xxx,,label1==xxx,,label2==xxx
func (t *PrometheusLabelTable) testString(request string) string {
req := &trident.PrometheusLabelRequest{}
metricReq := &trident.MetricLabelRequest{}
targetReq := &trident.TargetRequest{}
keyValues := strings.Split(request, ",")

keyValues := strings.Split(request, ",,")
clusterId := 0
for _, kv := range keyValues {
kv := strings.Split(kv, "=")
kv := strings.Split(kv, "==")
if len(kv) != 2 {
continue
}
Expand Down

0 comments on commit bbb792b

Please sign in to comment.