Skip to content

Commit

Permalink
prometheus_backend: fix mapping for non-tagged metrics
Browse files Browse the repository at this point in the history
Fixes #465
  • Loading branch information
Civil committed May 17, 2020
1 parent 661001c commit 05e4479
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions zipper/protocols/prometheus/prometheus_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import (
"context"
"encoding/json"
"fmt"
"net"
"net/http"
"net/url"
"strconv"
"strings"
"time"

"github.com/ansel1/merry"
"github.com/go-graphite/carbonapi/limiter"
"github.com/go-graphite/carbonapi/zipper/helper"
"github.com/go-graphite/carbonapi/zipper/httpHeaders"
"github.com/go-graphite/carbonapi/zipper/metadata"
"github.com/go-graphite/carbonapi/zipper/types"
protov3 "github.com/go-graphite/protocol/carbonapi_v3_pb"
"net"
"net/http"
"net/url"
"strconv"
"strings"
"time"

"go.uber.org/zap"
)
Expand Down Expand Up @@ -215,7 +216,8 @@ func (c *PrometheusGroup) Fetch(ctx context.Context, request *protov3.MultiFetch
if strings.HasPrefix(target, "seriesByTag") {
stepLocalStr, target = c.seriesByTagToPromQL(stepLocalStr, target)
} else {
target = convertGraphiteTargetToPromQL(target)
reQuery := convertGraphiteTargetToPromQL(target)
target = "{__name__=~\"" + reQuery + "\"}"
}
if stepLocalStr[len(stepLocalStr)-1] >= '0' && stepLocalStr[len(stepLocalStr)-1] <= '9' {
stepLocalStr += "s"
Expand Down

0 comments on commit 05e4479

Please sign in to comment.