Skip to content

Commit

Permalink
Upgrade to latest dskit
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
  • Loading branch information
aknuds1 committed Jul 6, 2022
1 parent 7777802 commit dad8218
Show file tree
Hide file tree
Showing 24 changed files with 355 additions and 540 deletions.
87 changes: 87 additions & 0 deletions cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,16 @@
"fieldType": "string",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "log_request_at_info_level_enabled",
"required": false,
"desc": "Optionally log requests at info level instead of debug level.",
"fieldValue": null,
"fieldDefaultValue": false,
"fieldFlag": "server.log-request-at-info-level-enabled",
"fieldType": "boolean"
},
{
"kind": "field",
"name": "http_path_prefix",
Expand Down Expand Up @@ -693,6 +703,17 @@
"fieldFlag": "distributor.ha-tracker.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "distributor.ha-tracker.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -1013,6 +1034,17 @@
"fieldFlag": "distributor.ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "distributor.ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -1860,6 +1892,17 @@
"fieldFlag": "ingester.ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "ingester.ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -5749,6 +5792,17 @@
"fieldFlag": "compactor.ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "compactor.ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -6166,6 +6220,17 @@
"fieldFlag": "store-gateway.sharding-ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "store-gateway.sharding-ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -7062,6 +7127,17 @@
"fieldFlag": "ruler.ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "ruler.ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down Expand Up @@ -8375,6 +8451,17 @@
"fieldFlag": "alertmanager.sharding-ring.consul.watch-burst-size",
"fieldType": "int",
"fieldCategory": "advanced"
},
{
"kind": "field",
"name": "cas_retry_delay",
"required": false,
"desc": "Maximum duration to wait before retrying a Compare And Swap (CAS) operation.",
"fieldValue": null,
"fieldDefaultValue": 1000000000,
"fieldFlag": "alertmanager.sharding-ring.consul.cas-retry-delay",
"fieldType": "duration",
"fieldCategory": "advanced"
}
],
"fieldValue": null,
Expand Down
16 changes: 16 additions & 0 deletions cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ Usage of ./cmd/mimir/mimir:
True to block private and local addresses in Alertmanager receiver integrations. It blocks private addresses defined by RFC 1918 (IPv4 addresses) and RFC 4193 (IPv6 addresses), as well as loopback, local unicast and local multicast addresses.
-alertmanager.sharding-ring.consul.acl-token string
ACL Token used to interact with Consul.
-alertmanager.sharding-ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-alertmanager.sharding-ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-alertmanager.sharding-ring.consul.consistent-reads
Expand Down Expand Up @@ -565,6 +567,8 @@ Usage of ./cmd/mimir/mimir:
Number of Go routines to use when syncing block meta files from the long term storage. (default 20)
-compactor.ring.consul.acl-token string
ACL Token used to interact with Consul.
-compactor.ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-compactor.ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-compactor.ring.consul.consistent-reads
Expand Down Expand Up @@ -657,6 +661,8 @@ Usage of ./cmd/mimir/mimir:
Prometheus label to look for in samples to identify a Prometheus HA cluster. (default "cluster")
-distributor.ha-tracker.consul.acl-token string
ACL Token used to interact with Consul.
-distributor.ha-tracker.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-distributor.ha-tracker.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-distributor.ha-tracker.consul.consistent-reads
Expand Down Expand Up @@ -737,6 +743,8 @@ Usage of ./cmd/mimir/mimir:
[experimental] Per-tenant request rate limit in requests per second. 0 to disable.
-distributor.ring.consul.acl-token string
ACL Token used to interact with Consul.
-distributor.ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-distributor.ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-distributor.ring.consul.consistent-reads
Expand Down Expand Up @@ -871,6 +879,8 @@ Usage of ./cmd/mimir/mimir:
Period with which to update the per-tenant ingestion rates. (default 15s)
-ingester.ring.consul.acl-token string
ACL Token used to interact with Consul.
-ingester.ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-ingester.ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-ingester.ring.consul.consistent-reads
Expand Down Expand Up @@ -1456,6 +1466,8 @@ Usage of ./cmd/mimir/mimir:
Minimum amount of time to wait before resending an alert to Alertmanager. (default 1m0s)
-ruler.ring.consul.acl-token string
ACL Token used to interact with Consul.
-ruler.ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-ruler.ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-ruler.ring.consul.consistent-reads
Expand Down Expand Up @@ -1584,6 +1596,8 @@ Usage of ./cmd/mimir/mimir:
HTTP server key path.
-server.http-write-timeout duration
Write timeout for HTTP server (default 30s)
-server.log-request-at-info-level-enabled
Optionally log requests at info level instead of debug level.
-server.log-source-ips-enabled
Optionally log the source IPs.
-server.log-source-ips-header string
Expand All @@ -1596,6 +1610,8 @@ Usage of ./cmd/mimir/mimir:
Register the intrumentation handlers (/metrics etc). (default true)
-store-gateway.sharding-ring.consul.acl-token string
ACL Token used to interact with Consul.
-store-gateway.sharding-ring.consul.cas-retry-delay duration
Maximum duration to wait before retrying a Compare And Swap (CAS) operation. (default 1s)
-store-gateway.sharding-ring.consul.client-timeout duration
HTTP timeout when talking to Consul (default 20s)
-store-gateway.sharding-ring.consul.consistent-reads
Expand Down
2 changes: 2 additions & 0 deletions cmd/mimir/help.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ Usage of ./cmd/mimir/mimir:
HTTP server listen address.
-server.http-listen-port int
HTTP server listen port. (default 8080)
-server.log-request-at-info-level-enabled
Optionally log requests at info level instead of debug level.
-store-gateway.sharding-ring.consul.hostname string
Hostname and port of Consul. (default "localhost:8500")
-store-gateway.sharding-ring.etcd.endpoints value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ grpc_tls_config:
# CLI flag: -server.log-source-ips-regex
[log_source_ips_regex: <string> | default = ""]
# Optionally log requests at info level instead of debug level.
# CLI flag: -server.log-request-at-info-level-enabled
[log_request_at_info_level_enabled: <boolean> | default = false]
# (advanced) Base path to serve all API routes from (e.g. /v1/)
# CLI flag: -server.path-prefix
[http_path_prefix: <string> | default = ""]
Expand Down Expand Up @@ -2437,6 +2441,11 @@ The `consul` block configures the consul client. The supported CLI flags `<prefi
# (advanced) Burst size used in rate limit. Values less than 1 are treated as 1.
# CLI flag: -<prefix>.consul.watch-burst-size
[watch_burst_size: <int> | default = 1]
# (advanced) Maximum duration to wait before retrying a Compare And Swap (CAS)
# operation.
# CLI flag: -<prefix>.consul.cas-retry-delay
[cas_retry_delay: <duration> | default = 1s]
```

### memberlist
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.0
github.com/grafana/dskit v0.0.0-20220622130855-7bb188ccf75a
github.com/grafana/dskit v0.0.0-20220704121012-e441b77be778
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe
github.com/hashicorp/golang-lru v0.5.4
github.com/json-iterator/go v1.1.12
Expand All @@ -39,7 +39,7 @@ require (
github.com/stretchr/testify v1.7.2
github.com/thanos-io/thanos v0.26.1-0.20220602051129-a6f6ce060ed4
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/weaveworks/common v0.0.0-20211109170639-0684aab3d884
github.com/weaveworks/common v0.0.0-20220706100410-67d27ed40fae
go.uber.org/atomic v1.9.0
go.uber.org/goleak v1.1.12
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
Expand Down Expand Up @@ -177,7 +177,6 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/exporter-toolkit v0.7.1 // indirect
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/rs/cors v1.8.2 // indirect
Expand Down
12 changes: 7 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4=
github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
Expand Down Expand Up @@ -738,8 +739,8 @@ github.com/gosimple/slug v1.1.1 h1:fRu/digW+NMwBIP+RmviTK97Ho/bEj/C9swrCspN3D4=
github.com/gosimple/slug v1.1.1/go.mod h1:ER78kgg1Mv0NQGlXiDe57DpCyfbNywXXZ9mIorhxAf0=
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
github.com/grafana/dskit v0.0.0-20220112093026-95274ccc858d/go.mod h1:M0/dlftwBvH7+hdNNpjMa/CUXD7gsew67mbkCuDlFXE=
github.com/grafana/dskit v0.0.0-20220622130855-7bb188ccf75a h1:D9L8ZU8QlXxUb9lQwiNLamt0nJXXETJVmtF7DxSqc9g=
github.com/grafana/dskit v0.0.0-20220622130855-7bb188ccf75a/go.mod h1:9It/K30QPyj/FuTqBb/SYnaS4/BJCP5YL4SRfXB7dG0=
github.com/grafana/dskit v0.0.0-20220704121012-e441b77be778 h1:JiAXp2IDSqW1q5rmPfMYyetuOr4GFLMCe9WvvnL5n9g=
github.com/grafana/dskit v0.0.0-20220704121012-e441b77be778/go.mod h1:vDNKB8ExYS07ItQoxr13Tjq1Kd2IQ7IsvmJLn9kK+g0=
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe h1:mxrRWDjKtob43xF9nEhJthdtCzX35/800Sk7nE//YHQ=
github.com/grafana/e2e v0.1.1-0.20220519104354-1db01e4751fe/go.mod h1:+26VJWpczg2OU3D0537acnHSHzhJORpxOs6F+M27tZo=
github.com/grafana/memberlist v0.3.1-0.20220425183535-6b97a09b7167 h1:PgEQkGHR4YimSCEGT5IoswN9gJKZDVskf+he6UClCLw=
Expand Down Expand Up @@ -1158,9 +1159,9 @@ github.com/prometheus/common/assets v0.1.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwB
github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4=
github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI=
github.com/prometheus/exporter-toolkit v0.6.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
github.com/prometheus/exporter-toolkit v0.7.0/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
github.com/prometheus/exporter-toolkit v0.7.1 h1:c6RXaK8xBVercEeUQ4tRNL8UGWzDHfvj9dseo1FcK1Y=
github.com/prometheus/exporter-toolkit v0.7.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g=
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 h1:dTUS1vaLWq+Y6XKOTnrFpoVsQKLCbCp1OLj24TDi7oM=
github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289/go.mod h1:FGbBv5OPKjch+jNUJmEQpMZytIdyW0NdBtWFcfSKusc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
Expand Down Expand Up @@ -1287,8 +1288,9 @@ github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv
github.com/vultr/govultr/v2 v2.17.1 h1:UBmotwA0mkGtyJMakUF9jhLH/W3mN5wfGRn543i/BCA=
github.com/vultr/govultr/v2 v2.17.1/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
github.com/weaveworks/common v0.0.0-20210913144402-035033b78a78/go.mod h1:YU9FvnS7kUnRt6HY10G+2qHkwzP3n3Vb1XsXDsJTSp8=
github.com/weaveworks/common v0.0.0-20211109170639-0684aab3d884 h1:8xKd5YG67aKrYwyxXA55ox7AjCMqiMq4gWBVi+lkKLE=
github.com/weaveworks/common v0.0.0-20211109170639-0684aab3d884/go.mod h1:GWX2dQ7yjrgvqH0+d3kCJC5bsY8oOFwqjxFMHaRK4/k=
github.com/weaveworks/common v0.0.0-20220629114710-e3b70df0f08b/go.mod h1:YfOOLoW1Q/jIIu0WLeSwgStmrKjuJEZSKTAUc+0KFvE=
github.com/weaveworks/common v0.0.0-20220706100410-67d27ed40fae h1:Z8YibUpdBEdCq8nwrYXJQ8vYooevbmEBIdFpseXK3/8=
github.com/weaveworks/common v0.0.0-20220706100410-67d27ed40fae/go.mod h1:YfOOLoW1Q/jIIu0WLeSwgStmrKjuJEZSKTAUc+0KFvE=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs=
Expand Down
1 change: 1 addition & 0 deletions pkg/mimir/mimir.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (c *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
c.ApplicationName = "Grafana Mimir"
c.Server.MetricsNamespace = "cortex"
c.Server.ExcludeRequestInLog = true
c.Server.DisableRequestSuccessLog = true

// Set the default module list to 'all'
c.Target = []string{All}
Expand Down
3 changes: 1 addition & 2 deletions pkg/querier/worker/scheduler_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/go-kit/log/level"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/grpcclient"
dsmiddleware "github.com/grafana/dskit/middleware"
"github.com/grafana/dskit/ring/client"
"github.com/grafana/dskit/services"
otgrpc "github.com/opentracing-contrib/go-grpc"
Expand Down Expand Up @@ -219,7 +218,7 @@ func (sp *schedulerProcessor) createFrontendClient(addr string) (client.PoolClie
opts, err := sp.grpcConfig.DialOption([]grpc.UnaryClientInterceptor{
otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer()),
middleware.ClientUserHeaderInterceptor,
dsmiddleware.PrometheusGRPCUnaryInstrumentation(sp.frontendClientRequestDuration),
middleware.UnaryClientInstrumentInterceptor(sp.frontendClientRequestDuration),
}, nil)

if err != nil {
Expand Down
6 changes: 2 additions & 4 deletions vendor/github.com/grafana/dskit/grpcclient/instrumentation.go

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

Loading

0 comments on commit dad8218

Please sign in to comment.