prometheus/tsdb
Julien Duchesne 8855c2e626
Add prometheus_tsdb_clean_start metric (#8824)
Add cleanup of the lockfile when the db is cleanly closed

The metric describes the status of the lockfile on startup
0: Already existed
1: Did not exist
-1: Disabled

Therefore, if the min value over time of this metric is 0, that means that executions have exited uncleanly
We can then use that metric to have a much lower threshold on the crashlooping alert:

If the metric exists and it has been zero, two restarts is enough to trigger the alarm
If it does not exist (old prom version for example), the current five restarts threshold remains

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>

* Change metric name + set unset value to -1

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>

* Only check the last value of the clean start alert

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>

* Fix test + nit

Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
2021-06-16 15:03:02 +05:30
..
chunkenc Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
chunks Stop the bleed on chunk mapper panic (#8723) 2021-05-06 14:18:59 -06:00
docs/format Add Exemplar Remote Write support (#8296) 2021-05-06 13:53:52 -07:00
encoding Avoid WriteAt for Postings. 2019-12-16 15:30:49 +00:00
errors MultiError: Refactored MultiError for more concise and safe usage. (#8066) 2020-10-28 15:24:58 +00:00
fileutil More info in mmap error message (#8058) 2020-10-15 12:58:13 +05:30
goversion tsdb: test for leaks (#7566) 2020-07-21 10:08:06 +02:00
index typos correct 2021-05-20 09:52:33 +08:00
record Add Exemplar Remote Write support (#8296) 2021-05-06 13:53:52 -07:00
test labels: Reduce allocated memory and latency of Hash method; Added tests. (#8025) 2020-10-15 11:31:28 +01:00
testdata tsdb: Delete blocks atomically; Remove tmp blocks on start; Added test. (#7772) 2020-08-11 06:56:08 +01:00
tombstones Switched to go-kit/log 2021-06-11 12:28:36 -04:00
tsdbutil storage: Split chunks if more than 120 samples (#8582) 2021-05-18 18:37:16 +02:00
wal Switched to go-kit/log 2021-06-11 12:28:36 -04:00
.gitignore Moving tsdb into its own subdirectory 2019-08-13 13:58:49 +05:30
block.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
block_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
blockwriter.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
blockwriter_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
CHANGELOG.md Rename default branch to main 2021-02-22 20:28:02 +01:00
compact.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
compact_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
db.go Add prometheus_tsdb_clean_start metric (#8824) 2021-06-16 15:03:02 +05:30
db_test.go Add prometheus_tsdb_clean_start metric (#8824) 2021-06-16 15:03:02 +05:30
exemplar.go validate exemplar labelSet length first (#8816) 2021-05-12 20:17:05 +05:30
exemplar_test.go typos correct 2021-05-20 09:52:33 +08:00
head.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
head_bench_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
head_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
isolation.go Optimise lowWatermark in Isolation (#7332) 2020-06-03 20:09:05 +02:00
isolation_test.go Optimise lowWatermark in Isolation (#7332) 2020-06-03 20:09:05 +02:00
mocks_test.go Move away from testutil, refactor imports (#8087) 2020-10-22 11:00:08 +02:00
querier.go Correct spelling of "iterable" (#8713) 2021-04-12 21:43:42 +01:00
querier_bench_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
querier_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
README.md Link blog post on TSDB queries in tsdb/README.md (#8391) 2021-01-21 17:14:40 +05:30
repair.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
repair_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
tsdbblockutil.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
wal.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
wal_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00

TSDB

GoDoc

This directory contains the Prometheus storage layer that is used in its 2.x releases.

A writeup of its design can be found here.

Based on the Gorilla TSDB white papers.

Video: Storing 16 Bytes at Scale from PromCon 2017.

See also the format documentation.

A series of blog posts explaining different components of TSDB: