Skip to content

Commit 71e08e5

Browse files
committed
Updated architecture doc
Signed-off-by: Marco Pracucci <[email protected]>
1 parent 72e47bf commit 71e08e5

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
* [ENHANCEMENT] Added `password` and `enable_tls` options to redis cache configuration. Enables usage of Microsoft Azure Cache for Redis service.
2121
* [BUGFIX] Fixed unnecessary CAS operations done by the HA tracker when the jitter is enabled. #1861
2222
* [BUGFIX] Fixed #1904 ingesters getting stuck in a LEAVING state after coming up from an ungraceful exit. #1921
23-
* [BUGFIX] Fixed unnecessary CAS operations done by the HA tracker when the jitter is enabled. #1861
24-
* [BUGFIX] Fixed handling of out of order/bound samples in ingesters with the experimental TSDB blocks storage. #1864
25-
* [BUGFIX] Fixed querying ingesters in `LEAVING` state with the experimental TSDB blocks storage. #1854
26-
* [BUGFIX] Fixed error handling in the series to chunks conversion with the experimental TSDB blocks storage. #1837
27-
* [BUGFIX] Fixed TSDB creation conflict with blocks transfer in a `JOINING` ingester with the experimental TSDB blocks storage. #1818
23+
* [BUGFIX] TSDB: Fixed handling of out of order/bound samples in ingesters with the experimental TSDB blocks storage. #1864
24+
* [BUGFIX] TSDB: Fixed querying ingesters in `LEAVING` state with the experimental TSDB blocks storage. #1854
25+
* [BUGFIX] TSDB: Fixed error handling in the series to chunks conversion with the experimental TSDB blocks storage. #1837
26+
* [BUGFIX] TSDB: Fixed TSDB creation conflict with blocks transfer in a `JOINING` ingester with the experimental TSDB blocks storage. #1818
2827

2928
## 0.4.0 / 2019-12-02
3029

docs/architecture.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The two engines mostly share the same Cortex architecture with few differences o
2828

2929
### Chunks storage (default)
3030

31-
The chunks storage stores each single time series into a separate object called _Chunk_. Each Chunk contains the timestamp-value pairs for a given period (defaults to 12 hours) of the series. Chunks are then indexed by time range and labels, in order to provide a fast lookup across many (over millions) Chunks.
31+
The chunks storage stores each single time series into a separate object called _Chunk_. Each Chunk contains the samples for a given period (defaults to 12 hours). Chunks are then indexed by time range and labels, in order to provide a fast lookup across many (over millions) Chunks.
3232

3333
For this reason, the chunks storage consists of:
3434

@@ -53,7 +53,7 @@ The current schema recommendation is the **v10 schema** (v11 is still experiment
5353

5454
The blocks storage is based on [Prometheus TSDB](https://prometheus.io/docs/prometheus/latest/storage/): it stores each tenant's time series into their own TSDB which write out their series to a on-disk Block (defaults to 2h block range periods). Each Block is composed by few files storing the chunks and the block index.
5555

56-
The TSDB chunk files contain the timestamp-value pairs for multiple series. The series inside the Chunks are then indexed by a per-block index, which indexes metric names and labels to time series in the chunk files.
56+
The TSDB chunk files contain the samples for multiple series. The series inside the Chunks are then indexed by a per-block index, which indexes metric names and labels to time series in the chunk files.
5757

5858
The blocks storage doesn't require a dedicated storage backend for the index. The only requirement is an object store for the Block files, which can be:
5959

@@ -64,7 +64,7 @@ For more information, please check out the [Blocks storage](operations/blocks-st
6464

6565
## Services
6666

67-
Cortex has a service-based architecture, in which the overall system is split up into a variety of components that perform a specific task, run separately, and in parallel.
67+
Cortex has a service-based architecture, in which the overall system is split up into a variety of components that perform a specific task, run separately, and in parallel. Cortex can alternatively run in a single process mode, where all components are executed within a single process. The single process mode is particularly handy for local testing and development.
6868

6969
Cortex is, for the most part, a shared-nothing system. Each layer of the system can run multiple instances of each component and they don't coordinate or communicate with each other within that layer.
7070

@@ -79,11 +79,11 @@ The Cortex services are:
7979

8080
### Distributor
8181

82-
The **distributor** service is responsible for handling incoming series from Prometheus. It's the first stop in the write path for series samples. Once the distributor receives samples from Prometheus, each series is validated for correctness and to ensure that it is within the configured tenant limits, falling back to default ones in case limits have not been overridden for the specific tenant. Valid samples and then split into batches and sent to multiple [ingesters](#ingester) in parallel.
82+
The **distributor** service is responsible for handling incoming samples from Prometheus. It's the first stop in the write path for series samples. Once the distributor receives samples from Prometheus, each sample is validated for correctness and to ensure that it is within the configured tenant limits, falling back to default ones in case limits have not been overridden for the specific tenant. Valid samples are then split into batches and sent to multiple [ingesters](#ingester) in parallel.
8383

8484
The validation done by the distributor includes:
8585

86-
- The metric name is formally correct
86+
- The metric labels name are formally correct
8787
- The configured max number of labels per metric is respected
8888
- The configured max length of a label name and value is respected
8989
- The timestamp is not older/newer than the configured min/max time range
@@ -107,18 +107,14 @@ For more information, please refer to [config for sending HA pairs data to Corte
107107

108108
#### Hashing
109109

110-
Distributors use consistent hashing, in conjunction with a configurable replication factor, to determine which ingester instances should receive a given series.
110+
Distributors use consistent hashing, in conjunction with a configurable replication factor, to determine which ingester instance(s) should receive a given series.
111111

112112
Cortex supports two hashing strategies:
113113

114114
1. Hash the metric name and tenant ID (default)
115-
2. Hash the metric name, labels and tenant ID (recommended, enabled with `-distributor.shard-by-all-labels=true`)
115+
2. Hash the metric name, labels and tenant ID (enabled with `-distributor.shard-by-all-labels=true`)
116116

117-
The trade-off associated with the latter is that writes are more balanced across ingesters but each query needs to talk to any ingester since a metric could be spread across any ingester given different label sets. The first hashing strategy (default) was originally chosen to reduce the number of required ingesters on the query path, but running Cortex in production showed that an evenly distributed write load on the ingesters is preferable at the cost of always querying all ingesters.
118-
119-
The trade-off associated with the latter is that writes are more balanced across ingesters, but requires each query to look across all ingesters, since a metric could be spread across any ingester given different label sets.
120-
121-
The first hashing strategy (default) was originally chosen to reduce the number of required ingesters on the query path, but running Cortex in production showed that an evenly distributed write load on the ingesters is preferable at the cost of always querying most of the ingesters.
117+
The trade-off associated with the latter is that writes are more balanced across ingesters but each query needs to talk to any ingester since a metric could be spread across multiple ingesters given different label sets.
122118

123119
#### The hash ring
124120

@@ -197,7 +193,7 @@ Queriers are **stateless** and can be scaled up and down as needed.
197193

198194
### Query frontend
199195

200-
The **query frontend** is an **optional service** providing the same querier's API endpoints and can be used to accelerate the read path. When the query frontend is in place, incoming query requests should be directed to the query frontend instead of the queriers. The querier service will be still required within the cluster, in order to execute the actual queries.
196+
The **query frontend** is an **optional service** providing the querier's API endpoints and can be used to accelerate the read path. When the query frontend is in place, incoming query requests should be directed to the query frontend instead of the queriers. The querier service will be still required within the cluster, in order to execute the actual queries.
201197

202198
The query frontend internally performs some query adjustments and holds queries in an internal queue. In this setup, queriers act as workers which pull jobs from the queue, execute them, and return them to the query-frontend for aggregation. Queriers need to be configured with the query frontend address - via the `-querier.frontend-address` CLI flag - in order to allow them to connect to the query frontends.
203199

0 commit comments

Comments
 (0)