Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Jan 15, 2024
1 parent 14ad50c commit dfb9bea
Show file tree
Hide file tree
Showing 49 changed files with 1,447 additions and 938 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require (
github.com/spf13/afero v1.9.5
github.com/stretchr/testify v1.8.4
github.com/thanos-io/objstore v0.0.0-20231231041903-61cfed8cbb9d
github.com/thanos-io/promql-engine v0.0.0-20231214130043-41b2cf818e81
github.com/thanos-io/promql-engine v0.0.0-20240114143142-008379eda2f9
github.com/thanos-io/thanos v0.33.1-0.20231224215600-665e64370a2c
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20221201103051-7c2720a9024d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,8 @@ github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1
github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM=
github.com/thanos-io/objstore v0.0.0-20231231041903-61cfed8cbb9d h1:rTz1FIWYPS4R7H/hdZPaVRfevHdfv7BOjJ2FQG747KQ=
github.com/thanos-io/objstore v0.0.0-20231231041903-61cfed8cbb9d/go.mod h1:RMvJQnpB4QQiYGg1gF8mnPJg6IkIPY28Buh8f6b+F0c=
github.com/thanos-io/promql-engine v0.0.0-20231214130043-41b2cf818e81 h1:EdFfVjUhwfj6JRjuZf+EchsxBD+60T6X0rPbzhraJj4=
github.com/thanos-io/promql-engine v0.0.0-20231214130043-41b2cf818e81/go.mod h1:uzl2mg4OyB9A54Hhrk/wViZiZoHT2o2qq+NGQkEmfzs=
github.com/thanos-io/promql-engine v0.0.0-20240114143142-008379eda2f9 h1:eycUuFjQHWGwn1c/UkJqixYPq3vMxpMFiNvTcWjZNUs=
github.com/thanos-io/promql-engine v0.0.0-20240114143142-008379eda2f9/go.mod h1:3pmodeI6v0zeezI1m9dE0ZaUXqiNSceZj1ZrQIXvHE4=
github.com/thanos-io/thanos v0.33.1-0.20231224215600-665e64370a2c h1:4Ftcc3CJL6puX5FQUvFzhjhM6xF6NdlEZPrxMzeZ6vY=
github.com/thanos-io/thanos v0.33.1-0.20231224215600-665e64370a2c/go.mod h1:P7euwwXd8qA71hRJj/EiE4rDC3354FAW2wB2/qW4agA=
github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU=
Expand Down
24 changes: 11 additions & 13 deletions pkg/cortexpb/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import (
"time"
"unsafe"

"github.com/cortexproject/cortex/pkg/util"
jsoniter "github.com/json-iterator/go"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/exemplar"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/textparse"

"github.com/cortexproject/cortex/pkg/util"
)

// ToWriteRequest converts matched slices of Labels, Samples and Metadata into a WriteRequest proto.
Expand Down Expand Up @@ -158,26 +156,26 @@ func (s byLabel) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

// MetricMetadataMetricTypeToMetricType converts a metric type from our internal client
// to a Prometheus one.
func MetricMetadataMetricTypeToMetricType(mt MetricMetadata_MetricType) textparse.MetricType {
func MetricMetadataMetricTypeToMetricType(mt MetricMetadata_MetricType) model.MetricType {
switch mt {
case UNKNOWN:
return textparse.MetricTypeUnknown
return model.MetricTypeUnknown
case COUNTER:
return textparse.MetricTypeCounter
return model.MetricTypeCounter
case GAUGE:
return textparse.MetricTypeGauge
return model.MetricTypeGauge
case HISTOGRAM:
return textparse.MetricTypeHistogram
return model.MetricTypeHistogram
case GAUGEHISTOGRAM:
return textparse.MetricTypeGaugeHistogram
return model.MetricTypeGaugeHistogram
case SUMMARY:
return textparse.MetricTypeSummary
return model.MetricTypeSummary
case INFO:
return textparse.MetricTypeInfo
return model.MetricTypeInfo
case STATESET:
return textparse.MetricTypeStateset
return model.MetricTypeStateset
default:
return textparse.MetricTypeUnknown
return model.MetricTypeUnknown
}
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/cortexpb/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"unsafe"

jsoniter "github.com/json-iterator/go"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/textparse"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -75,22 +75,22 @@ func TestMetricMetadataToMetricTypeToMetricType(t *testing.T) {
tc := []struct {
desc string
input MetricMetadata_MetricType
expected textparse.MetricType
expected model.MetricType
}{
{
desc: "with a single-word metric",
input: COUNTER,
expected: textparse.MetricTypeCounter,
expected: model.MetricTypeCounter,
},
{
desc: "with a two-word metric",
input: STATESET,
expected: textparse.MetricTypeStateset,
expected: model.MetricTypeStateset,
},
{
desc: "with an unknown metric",
input: MetricMetadata_MetricType(100),
expected: textparse.MetricTypeUnknown,
expected: model.MetricTypeUnknown,
},
}

Expand Down
32 changes: 15 additions & 17 deletions vendor/github.com/thanos-io/promql-engine/engine/engine.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions vendor/github.com/thanos-io/promql-engine/engine/explain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dfb9bea

Please sign in to comment.