Skip to content

Commit c63d9cb

Browse files
committed
Merge remote-tracking branch 'upstream/master' into vendor
Signed-off-by: Ganesh Vernekar <[email protected]>
2 parents 5d6c805 + dd087ff commit c63d9cb

File tree

252 files changed

+38668
-8731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+38668
-8731
lines changed

LICENSE

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Apache License
32
Version 2.0, January 2004
43
http://www.apache.org/licenses/
@@ -176,7 +175,18 @@
176175

177176
END OF TERMS AND CONDITIONS
178177

179-
Copyright 2014-2017 Weaveworks Ltd.
178+
APPENDIX: How to apply the Apache License to your work.
179+
180+
To apply the Apache License to your work, attach the following
181+
boilerplate notice, with the fields enclosed by brackets "[]"
182+
replaced with your own identifying information. (Don't include
183+
the brackets!) The text should be enclosed in the appropriate
184+
comment syntax for the file format. We also recommend that a
185+
file or class name and description of purpose be included on the
186+
same "printed page" as the copyright notice for easier
187+
identification within third-party archives.
188+
189+
Copyright [yyyy] [name of copyright owner]
180190

181191
Licensed under the Apache License, Version 2.0 (the "License");
182192
you may not use this file except in compliance with the License.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ $(foreach exe, $(EXES), $(eval $(call dep_exe, $(exe))))
5050
pkg/ingester/client/cortex.pb.go: pkg/ingester/client/cortex.proto
5151
pkg/ring/ring.pb.go: pkg/ring/ring.proto
5252
pkg/querier/frontend/frontend.pb.go: pkg/querier/frontend/frontend.proto
53+
pkg/querier/queryrange/queryrange.pb.go: pkg/querier/queryrange/queryrange.proto
5354
pkg/chunk/storage/caching_index_client.pb.go: pkg/chunk/storage/caching_index_client.proto
5455
pkg/distributor/ha_tracker.pb.go: pkg/distributor/ha_tracker.proto
5556
all: $(UPTODATE_FILES)

docs/architecture.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ The **distributor** service is responsible for handling samples written by Prome
2424

2525
Distributors communicate with ingesters via [gRPC](https://grpc.io). They are stateless and can be scaled up and down as needed.
2626

27+
If the HA Tracker is enabled, the Distributor will deduplicate incoming samples that contain both a cluster and replica label. It talks to a KVStore to store state about which replica per cluster it's accepting samples from for a given user ID. Samples with one or neither of these labels will be accepted by default.
28+
2729
#### Hashing
2830

2931
Distributors use consistent hashing, in conjunction with the (configurable) replication factor, to determine *which* instances of the ingester service receive each sample.
@@ -147,4 +149,4 @@ The interface works somewhat differently across the supported databases:
147149

148150
A set of schemas are used to map the matchers and label sets used on reads and writes to the chunk store into appropriate operations on the index. Schemas have been added as Cortex has evolved, mainly in an attempt to better load balance writes and improve query performance.
149151

150-
> The current schema recommendation is the **v10 schema**.
152+
> The current schema recommendation is the **v10 schema**.

docs/arguments.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,67 @@ The ingester query API was improved over time, but defaults to the old behaviour
9292
- `-distributor.extra-query-delay`
9393
This is used by a component with an embedded distributor (Querier and Ruler) to control how long to wait until sending more than the minimum amount of queries needed for a successful response.
9494

95+
- `distributor.ha-tracker.enable-for-all-users`
96+
Flag to enable, for all users, handling of samples with external labels identifying replicas in an HA Prometheus setup. This defaults to false, and is technically defined in the Distributor limits.
97+
98+
- `distributor.ha-tracker.enable`
99+
Enable the distributors HA tracker so that it can accept samples from Prometheus HA replicas gracefully (requires labels). Global (for distributors), this ensures that the necessary internal data structures for the HA handling are created. The option `enable-for-all-users` is still needed to enable ingestion of HA samples for all users.
100+
101+
### Ring/HA Tracker Store
102+
103+
The KVStore client is used by both the Ring and HA Tracker.
104+
- `{ring,distributor.ha-tracker}.prefix`
105+
The prefix for the keys in the store. Should end with a /. For example with a prefix of foo/, the key bar would be stored under foo/bar.
106+
- `{ring,distributor.ha-tracker}.store`
107+
Backend storage to use for the ring (consul, etcd, inmemory).
108+
109+
#### Consul
110+
111+
By default these flags are used to configure Consul used for the ring. To configure Consul for the HA tracker,
112+
prefix these flags with `distributor.ha-tracker.`
113+
114+
- `consul.hostname`
115+
Hostname and port of Consul.
116+
- `consul.acltoken`
117+
ACL token used to interact with Consul.
118+
- `consul.client-timeout`
119+
HTTP timeout when talking to Consul.
120+
- `consul.consistent-reads`
121+
Enable consistent reads to Consul.
122+
123+
#### etcd
124+
125+
By default these flags are used to configure etcd used for the ring. To configure etcd for the HA tracker,
126+
prefix these flags with `distributor.ha-tracker.`
127+
128+
- `etcd.endpoints`
129+
The etcd endpoints to connect to.
130+
- `etcd.dial-timeout`
131+
The timeout for the etcd connection.
132+
- `etcd.max-retries`
133+
The maximum number of retries to do for failed ops.
134+
135+
### HA Tracker
136+
137+
HA tracking has two of it's own flags:
138+
- `distributor.ha-tracker.cluster`
139+
Prometheus label to look for in samples to identify a Prometheus HA cluster. (default "cluster")
140+
- `distributor.ha-tracker.replica`
141+
Prometheus label to look for in samples to identify a Prometheus HA replica. (default "__replica__")
142+
143+
It's reasonable to assume people probably already have a `cluster` label, or something similar. If not, they should add one along with `__replica__`
144+
via external labels in their Prometheus config.
145+
146+
HA Tracking looks for the two labels (which can be overwritten per user)
147+
148+
It also talks to a KVStore and has it's own copies of the same flags used by the Distributor to connect to for the ring.
149+
- `distributor.ha-tracker.failover-timeout`
150+
If we don't receive any samples from the accepted replica for a cluster in this amount of time we will failover to the next replica we receive a sample from. This value must be greater than the update timeout (default 30s)
151+
- `distributor.ha-tracker.store`
152+
Backend storage to use for the ring (consul, etcd, inmemory). (default "consul")
153+
- `distributor.ha-tracker.update-timeout`
154+
Update the timestamp in the KV store for a given cluster/replica only after this amount of time has passed since the current stored timestamp. (default 15s)
155+
95156
## Ingester
96157

97158
- `-ingester.normalise-tokens`
@@ -185,4 +246,4 @@ Valid fields are (with their corresponding flags for default values):
185246

186247
- `s3.force-path-style`
187248

188-
Set this to `true` to force the request to use path-style addressing (`http://s3.amazonaws.com/BUCKET/KEY`). By default, the S3 client will use virtual hosted bucket addressing when possible (`http://BUCKET.s3.amazonaws.com/KEY`).
249+
Set this to `true` to force the request to use path-style addressing (`http://s3.amazonaws.com/BUCKET/KEY`). By default, the S3 client will use virtual hosted bucket addressing when possible (`http://BUCKET.s3.amazonaws.com/KEY`).

go.mod

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ require (
3636
github.com/hashicorp/go-cleanhttp v0.5.1
3737
github.com/jonboulle/clockwork v0.1.0
3838
github.com/json-iterator/go v1.1.6
39+
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
3940
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 // indirect
4041
github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 // indirect
4142
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
@@ -48,7 +49,7 @@ require (
4849
github.com/onsi/gomega v1.5.0 // indirect
4950
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02
5051
github.com/opentracing-contrib/go-stdlib v0.0.0-20170113013457-1de4cc2120e7
51-
github.com/opentracing/opentracing-go v1.0.2
52+
github.com/opentracing/opentracing-go v1.1.0
5253
github.com/philhofer/fwd v0.0.0-20160129035939-98c11a7a6ec8 // indirect
5354
github.com/pkg/errors v0.8.1
5455
github.com/prometheus/alertmanager v0.13.0
@@ -58,22 +59,27 @@ require (
5859
github.com/prometheus/tsdb v0.9.1
5960
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
6061
github.com/sercand/kuberesolver v2.1.0+incompatible // indirect
62+
github.com/sirupsen/logrus v1.4.2 // indirect
63+
github.com/spaolacci/murmur3 v1.1.0 // indirect
6164
github.com/stretchr/testify v1.3.0
6265
github.com/tinylib/msgp v0.0.0-20161221055906-38a6f61a768d // indirect
6366
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
6467
github.com/uber-go/atomic v1.3.2 // indirect
65-
github.com/uber/jaeger-client-go v2.14.0+incompatible
66-
github.com/uber/jaeger-lib v1.5.0 // indirect
68+
github.com/uber/jaeger-client-go v2.16.0+incompatible
69+
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
6770
github.com/weaveworks/billing-client v0.0.0-20171006123215-be0d55e547b1
6871
github.com/weaveworks/common v0.0.0-20190714171817-ddeaa31513fd
6972
github.com/weaveworks/mesh v0.0.0-20170131170447-5015f896ab62
7073
github.com/weaveworks/promrus v1.2.0 // indirect
7174
go.etcd.io/bbolt v1.3.3
7275
go.etcd.io/etcd v0.0.0-20190709142735-eb7dd97135a5
7376
go.uber.org/zap v1.10.0 // indirect
74-
golang.org/x/net v0.0.0-20190403144856-b630fd6fe46b
77+
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
78+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
79+
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect
80+
golang.org/x/text v0.3.2 // indirect
7581
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
76-
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
82+
golang.org/x/tools v0.0.0-20190602112858-2de7f9bf822c
7783
google.golang.org/api v0.4.0
7884
google.golang.org/grpc v1.19.1
7985
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect

0 commit comments

Comments
 (0)