You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/rule.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The rule component evaluates Prometheus recording and alerting rules against ran
14
14
15
15
The data of each rule node can be labeled to satisfy the clusters labeling scheme. High-availability pairs can be run in parallel and should be distinguished by the designated replica label, just like regular Prometheus servers.
Copy file name to clipboardExpand all lines: docs/components/sidecar.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,14 @@ Prometheus servers connected to the Thanos cluster via the sidecar are subject t
19
19
The retention is recommended to not be lower than three times the block duration. This achieves resilience in the face of connectivity issues
20
20
to the object storage since all local data will remain available within the Thanos cluster. If connectivity gets restored the backlog of blocks gets uploaded to the object storage.
Copy file name to clipboardExpand all lines: docs/components/store.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ menu: "components"
9
9
The store component of Thanos implements the Store API on top of historical data in an object storage bucket. It acts primarily as an API gateway and therefore does not need significant amounts of local disk space. It joins a Thanos cluster on startup and advertises the data it can access.
10
10
It keeps a small amount of information about all remote blocks on local disk and keeps it in sync with the bucket. This data is generally safe to delete across restarts at the cost of increased startup times.
Copy file name to clipboardExpand all lines: docs/design.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ The sidecar implements the gRPC service on top of Prometheus' [HTTP and remote-r
30
30
31
31
Data sources that persist their data for long-term storage do so via the Prometheus 2.0 storage engine. The storage engine periodically produces immutable blocks of data for a fixed time range. A block is a directory with a handful of larger files containing all sample data and peristed indices that are required to retrieve the data:
Copy file name to clipboardExpand all lines: docs/getting-started.md
+18-13
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
title: Getting Started
3
3
type: docs
4
4
menu: "thanos"
5
+
weight: 1
5
6
---
6
7
7
8
# Getting started
@@ -11,6 +12,10 @@ Thanos provides a global query view, data backup, and historical data access as
11
12
In this quick-start guide, we will configure Thanos and all components mentioned to work against a Google Cloud Storage bucket.
12
13
At the moment, Thanos is able to use [different storage providers](storage.md), with the ability to add more providers as necessary.
13
14
15
+
## Architecture Overview
16
+
17
+

18
+
14
19
## Requirements
15
20
16
21
* One or more [Prometheus](https://prometheus.io) v2.2.1+ installations
@@ -24,7 +29,7 @@ You can find the latest Thanos release [here](https://github.com/improbable-eng/
24
29
If you want to build Thanos from source -
25
30
with a working installation of the Go [toolchain](https://github.com/golang/tools) (`GOPATH`, `PATH=${GOPATH}/bin:${PATH}`), Thanos can be downloaded and built by running:
26
31
27
-
```
32
+
```bash
28
33
go get -d github.com/improbable-eng/thanos/...
@@ -52,7 +57,7 @@ NOTE: If you want to use `reload.*` flags for sidecar, make sure you enable `rel
52
57
53
58
The following configures the sidecar to only backup Prometheus data into a chosen object storage:
54
59
55
-
```
60
+
```bash
56
61
thanos sidecar \
57
62
--tsdb.path /var/prometheus \ # TSDB data directory of Prometheus
58
63
--prometheus.url "http://localhost:9090" \
@@ -75,7 +80,7 @@ The Sidecar component implements and exposes gRPC _[Store API](/pkg/store/storep
75
80
76
81
Let's extend the Sidecar in the previous section to connect to a Prometheus server, and expose the Store API.
77
82
78
-
```
83
+
```bash
79
84
thanos sidecar \
80
85
--tsdb.path /var/prometheus \
81
86
--objstore.config-file bucket_config.yaml \ # Bucket config file to send data to
@@ -93,7 +98,7 @@ Prometheus allows the configuration of "external labels" of a given Prometheus i
93
98
94
99
Every Prometheus instance must have a globally unique set of identifying labels. For example, in Prometheus's configuration file:
95
100
96
-
```
101
+
```yaml
97
102
global:
98
103
external_labels:
99
104
region: eu-west
@@ -112,7 +117,7 @@ Query also implements Prometheus's offical HTTP API and can thus be used with ex
112
117
113
118
Below, we will set up a Query to connect to our Sidecars, and expose its HTTP UI.
114
119
115
-
```
120
+
```bash
116
121
thanos query \
117
122
--http-address 0.0.0.0:19192 \ # HTTP Endpoint for Query UI
118
123
--store 1.2.3.4:19090 \ # Static gRPC Store API Address for the query node to query
@@ -127,7 +132,7 @@ The Query component is also capable of deduplicating data collected from Prometh
127
132
128
133
A typical choice is simply the label name "replica" while letting the value be whatever you wish. For example, you might set up the following in Prometheus's configuration file:
129
134
130
-
```
135
+
```yaml
131
136
global:
132
137
external_labels:
133
138
region: eu-west
@@ -138,7 +143,7 @@ global:
138
143
139
144
Reload your Prometheus instances, and then, in Query, we will enable `replica` as the label we want to enable deduplication to occur on:
140
145
141
-
```
146
+
```bash
142
147
thanos query \
143
148
--http-address 0.0.0.0:19192 \
144
149
--store 1.2.3.4:19090 \
@@ -158,7 +163,7 @@ The metadata includes the information about time windows and external labels for
158
163
There are various ways to tell query component about the StoreAPIs it should query data from. The simplest way is to use a static list of well known addresses to query.
159
164
These are repeatable so can add as many endpoint as needed. You can put DNS domain prefixed by `dns://` or `dns+srv://` to have Thanos Query do an `A` or `SRV` lookup to get all required IPs to communicate with.
160
165
161
-
```
166
+
```bash
162
167
thanos query \
163
168
--http-address 0.0.0.0:19192 \ # Endpoint for Query UI
164
169
--grpc-address 0.0.0.0:19092 \ # gRPC endpoint for Store API
@@ -175,7 +180,7 @@ Given a sidecar we can have it join a gossip cluster by advertising itself to ot
175
180
176
181
NOTE: Gossip will be removed. See [here](/docs/proposals/approved/201809_gossip-removal.md) why. New FileSD with DNS support is enabled and described [here](/docs/service_discovery.md)
177
182
178
-
```
183
+
```bash
179
184
thanos sidecar \
180
185
--prometheus.url http://localhost:9090 \
181
186
--tsdb.path /var/prometheus \
@@ -193,7 +198,7 @@ When a peer advertises itself / joins a gossip cluster it sends information abou
193
198
194
199
Once the Peer joins the cluster it will periodically update the information it sends out with new / updated information about other peers and the time windows for the metrics that it can access.
195
200
196
-
```
201
+
```bash
197
202
thanos query \
198
203
--http-address 0.0.0.0:19192 \ # Endpoint for Query UI
199
204
--grpc-address 0.0.0.0:19092 \ # gRPC endpoint for Store API
@@ -204,7 +209,7 @@ thanos query \
204
209
205
210
You can mix both static `store` and `cluster` based approaches:
206
211
207
-
```
212
+
```bash
208
213
thanos query \
209
214
--http-address 0.0.0.0:19192 \ # Endpoint for Query UI
210
215
--grpc-address 0.0.0.0:19092 \ # gRPC endpoint for Store API
@@ -233,7 +238,7 @@ As the sidecar backs up data into the object storage of your choice, you can dec
233
238
The store gateway does just that by implementing the same gRPC data API as the sidecars but backing it with data it can find in your object storage bucket.
234
239
Just like sidecars and query nodes, the store gateway exposes StoreAPI and needs to be discovered by Thanos Querier.
235
240
236
-
```
241
+
```bash
237
242
thanos store \
238
243
--data-dir /var/thanos/store \ # Disk space for local caches
239
244
--objstore.config-file bucket_config.yaml \ # Bucket to fetch data from
@@ -251,7 +256,7 @@ A local Prometheus installation periodically compacts older data to improve quer
251
256
252
257
The compactor component simple scans the object storage and processes compaction where required. At the same time it is responsible for creating downsampled copies of data to speed up queries.
253
258
254
-
```
259
+
```bash
255
260
thanos compact \
256
261
--data-dir /var/thanos/compact \ # Temporary workspace for data processing
257
262
--objstore.config-file bucket_config.yaml \ # Bucket where to apply the compacting
Copy file name to clipboardExpand all lines: docs/service-discovery.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,10 @@
1
-
# Thanos Service Discovery
1
+
---
2
+
title: Service Discovery
3
+
type: docs
4
+
menu: "thanos"
5
+
---
6
+
7
+
# Service Discovery
2
8
3
9
Service discovery has a vital place in Thanos components. It allows Thanos to discover different set API targets required to perform certain operations.
4
10
This logic is meant to replace Gossip that [is planned to be removed.](/docs/proposals/approved/201809_gossip-removal.md)
0 commit comments