mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Update dskit to the latest main (#62616)
* Update dskit to the latest main * Break free from a cortex depedency
This commit is contained in:
parent
49258b135a
commit
178f290f0c
18
go.mod
18
go.mod
@ -37,16 +37,14 @@ require (
|
||||
github.com/benbjohnson/clock v1.3.0
|
||||
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
|
||||
github.com/centrifugal/centrifuge v0.25.0
|
||||
github.com/cortexproject/cortex v1.10.1-0.20211014125347-85c378182d0d
|
||||
github.com/crewjam/saml v0.4.12
|
||||
github.com/denisenkom/go-mssqldb v0.12.0
|
||||
github.com/fatih/color v1.13.0
|
||||
github.com/gchaincl/sqlhooks v1.3.0
|
||||
github.com/getsentry/sentry-go v0.13.0
|
||||
github.com/go-git/go-git/v5 v5.4.2
|
||||
github.com/go-kit/kit v0.12.0 // indirect
|
||||
github.com/go-openapi/strfmt v0.21.3
|
||||
github.com/go-redis/redis/v8 v8.11.4
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/go-sourcemap/sourcemap v2.1.3+incompatible
|
||||
github.com/go-sql-driver/mysql v1.6.0
|
||||
github.com/go-stack/stack v1.8.1
|
||||
@ -98,7 +96,6 @@ require (
|
||||
github.com/uber/jaeger-client-go v2.29.1+incompatible
|
||||
github.com/urfave/cli/v2 v2.3.0
|
||||
github.com/vectordotdev/go-datemath v0.1.1-0.20220323213446-f3954d0b18ae
|
||||
github.com/weaveworks/common v0.0.0-20210913144402-035033b78a78 // indirect
|
||||
github.com/xorcare/pointer v1.1.0
|
||||
github.com/yalue/merged_fs v1.2.2
|
||||
github.com/yudai/gojsondiff v1.0.0
|
||||
@ -157,7 +154,6 @@ require (
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/edsrzf/mmap-go v1.0.0 // indirect
|
||||
github.com/emicklei/proto v1.10.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
||||
github.com/go-kit/log v0.2.1
|
||||
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
||||
github.com/go-openapi/analysis v0.21.4 // indirect
|
||||
@ -169,8 +165,6 @@ require (
|
||||
github.com/go-openapi/spec v0.20.7 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/go-openapi/validate v0.22.0 // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/gogo/status v1.1.0 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
|
||||
github.com/golang/glog v1.0.0 // indirect
|
||||
@ -207,18 +201,14 @@ require (
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e // indirect
|
||||
github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/common/sigv4 v0.1.0 // indirect
|
||||
github.com/prometheus/exporter-toolkit v0.8.2 // indirect
|
||||
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b // indirect
|
||||
github.com/rs/cors v1.8.3 // indirect
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
|
||||
github.com/segmentio/encoding v0.3.5
|
||||
github.com/sercand/kuberesolver v2.4.0+incompatible // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
|
||||
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
|
||||
@ -226,7 +216,6 @@ require (
|
||||
github.com/stretchr/objx v0.5.0 // indirect
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/weaveworks/promrus v1.2.0 // indirect
|
||||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
|
||||
go.mongodb.org/mongo-driver v1.11.1 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
@ -256,7 +245,7 @@ require (
|
||||
github.com/golang-migrate/migrate/v4 v4.7.0
|
||||
github.com/google/go-github/v45 v45.2.0
|
||||
github.com/grafana/codejen v0.0.3
|
||||
github.com/grafana/dskit v0.0.0-20211011144203-3a88ec0b675f
|
||||
github.com/grafana/dskit v0.0.0-20230126115530-71478074eab8
|
||||
github.com/grafana/phlare/api v0.1.2
|
||||
github.com/huandu/xstrings v1.3.1
|
||||
github.com/jmoiron/sqlx v1.3.5
|
||||
@ -287,6 +276,7 @@ require (
|
||||
cloud.google.com/go/compute/metadata v0.2.2 // indirect
|
||||
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/armon/go-metrics v0.4.1 // indirect
|
||||
github.com/bmatcuk/doublestar v1.1.1 // indirect
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
_ "github.com/beevik/etree"
|
||||
_ "github.com/blugelabs/bluge"
|
||||
_ "github.com/blugelabs/bluge_segment_api"
|
||||
_ "github.com/cortexproject/cortex/pkg/util"
|
||||
_ "github.com/crewjam/saml"
|
||||
_ "github.com/gobwas/glob"
|
||||
_ "github.com/googleapis/gax-go/v2"
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
cortex_util "github.com/cortexproject/cortex/pkg/util"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/prometheus/prometheus/pkg/labels"
|
||||
"github.com/prometheus/prometheus/promql"
|
||||
@ -92,7 +92,7 @@ func instantQueryResults(resp instantQueryResponse) (eval.Results, error) {
|
||||
return eval.Results{{
|
||||
Instance: map[string]string{},
|
||||
State: eval.Alerting,
|
||||
EvaluatedAt: cortex_util.TimeFromMillis(resp.Data.scalar.T),
|
||||
EvaluatedAt: TimeFromMillis(resp.Data.scalar.T),
|
||||
EvaluationString: extractEvalStringFromProm(sample{
|
||||
Value: resp.Data.scalar,
|
||||
}),
|
||||
@ -103,7 +103,7 @@ func instantQueryResults(resp instantQueryResponse) (eval.Results, error) {
|
||||
results = append(results, eval.Result{
|
||||
Instance: s.Metric.Map(),
|
||||
State: eval.Alerting,
|
||||
EvaluatedAt: cortex_util.TimeFromMillis(s.Value.T),
|
||||
EvaluatedAt: TimeFromMillis(s.Value.T),
|
||||
EvaluationString: extractEvalStringFromProm(s),
|
||||
})
|
||||
}
|
||||
@ -148,3 +148,9 @@ func extractEvalStringFromProm(s sample) string {
|
||||
sb.WriteString("]")
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
// TimeFromMillis Copied from https://github.com/grafana/mimir/blob/main/pkg/util/time.go as it doesn't seem worth it to import Mimir.
|
||||
// TimeFromMillis is a helper to turn milliseconds -> time.Time
|
||||
func TimeFromMillis(ms int64) time.Time {
|
||||
return time.Unix(ms/1000, (ms%1000)*int64(time.Millisecond)).UTC()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user