Commit graph

7546 commits

Author SHA1 Message Date
Benoît Knecht 1e1b2e163d Make interval overlap comparisons more explicit
Blocks are half-open intervals [a, b), while all other intervals
(chunks, head, ...) are closed intervals [a, b].

Make that distinction explicit by defining `OverlapsClosedInterval()`
methods for blocks and chunks, and using them in place of the more
generic `intervalOverlap()` function.

This change also fixes `db.Querier()` and `db.Delete()`, which could
previously return one extraneous block at the end of the specified
interval.

Signed-off-by: Benoît Knecht <benoit.knecht@fsfe.org>
2018-07-02 10:35:08 +02:00
Benoît Knecht 4ed6b9ed72 db: add test for chunks that span beyond a block's boundaries
Signed-off-by: Benoît Knecht <benoit.knecht@fsfe.org>
2018-07-02 10:32:05 +02:00
Benoît Knecht 0e4be5226a db: block MaxTime should not be part of the block
Block intervals are bound by `block.MinTime`, `block.MaxTime`, but they
define a half-open interval: `[block.MinTime, block.MaxTime).

However, when deciding if a chunk was part of a block or not, the
`intervalOverlap()` function would consider both the chunk and the block
intervals as being closed.

Rather than modify the login in `intervalOverlap()`, we explicitly
remove the last value from the interval when reading from head to
persist blocks.

Signed-off-by: Benoît Knecht <benoit.knecht@fsfe.org>
2018-07-02 10:32:05 +02:00
Fabian Reinartz f87d00d78d
Merge pull request #356 from prometheus/logrollback
Log series on rollback
2018-06-28 15:12:52 +02:00
Fabian Reinartz ea607b9fc3 Log series on rollback
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-28 09:04:07 -04:00
Fabian Reinartz 16727277e4
Merge pull request #354 from prometheus/cleandelete
Add resilience to crashes during deletion
2018-06-28 11:57:00 +02:00
Fabian Reinartz 087c4c6d3a Update doc comment
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-28 05:55:01 -04:00
Fabian Reinartz d907928e57 Clarify docs, error on unexpected meta read errors
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-27 12:05:21 -04:00
Fabian Reinartz af9003dcef Add resilience to crashes during deletion
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-27 09:50:31 -04:00
Fabian Reinartz 0b200798fe
Merge pull request #344 from simonpasquier/fix-out-of-range-index
chunks: fix potential "index out of range" error
2018-06-27 10:48:29 +02:00
Fabian Reinartz 0778d80ccf
Merge pull request #353 from cpatulea/patch-2
Update Appender.Add comment for uint64 refs.
2018-06-27 10:30:38 +02:00
Catalin Patulea 40766622ee
Update Appender.Add comment for uint64 refs.
Follow-up to prometheus 0efecea6d4.

Signed-off-by: Catalin Patulea <catalinp@google.com>
2018-06-26 14:15:58 -04:00
codwu cd145c90d5 remove put function and use RLock in Iter function
Signed-off-by: codwu <wuhan9087@163.com>
2018-06-25 21:52:11 +08:00
Simon Pasquier f55ccd4ecb Add unit tests
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-25 11:25:22 +02:00
Bryan Boreham 2bd510a63e Make TestUpdate() do some work (#4306)
Previously it would set no preconditions and check no postconditions,
as the `groups` member was empty.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2018-06-22 15:21:04 +01:00
Thomas Jackson a6dace8829 Check for timeout in each iteration of matrixSelector (#4300)
Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com>

Fixes #4288
2018-06-21 22:43:31 +01:00
Michael Khalil 78e0784d04 return error exit status in prometheus cli (#4296)
Signed-off-by: mikeykhalil <mikeyfkhalil@gmail.com>
2018-06-21 08:32:26 +01:00
Thomas Jackson 630f42fcf1 Timeout if populating iterators takes too long (#4291)
Right now promql won't time out a request if populating the iterators
takes a long time.

Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com>

Fixes #4289
2018-06-21 08:14:51 +01:00
Brian Brazil fb695fb435
Merge pull request #4285 from prometheus/release-2.3
Merge release-2.3 back to master
2018-06-20 14:51:00 +01:00
Simon Pasquier 22061306aa Address Julius's comment
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-20 09:19:49 +02:00
Brian Brazil 188ca45bd8
Merge pull request #4284 from prometheus/231
Release 2.3.1
2018-06-19 16:53:36 +01:00
Brian Brazil 141799da6e Release 2.3.1
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-06-19 13:12:11 +01:00
Tom Wilkie 4e4f0d4e41 spelling.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-19 13:03:01 +01:00
Tom Wilkie b8217720ac Review feedback.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-19 13:03:01 +01:00
Tom Wilkie e518f51a99 Extend API tests to cover remote read API.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-19 13:03:01 +01:00
Corentin Chary db9dbeeaec federation: nil pointer deference when using remove read
```
level=error ts=2018-06-13T07:19:04.515149169Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56202: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.516199547Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56204: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.51717692Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56206: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.564952878Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56208: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.566575791Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56210: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.567106063Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56212: runtime error: invalid memory address or nil pointer dereference"
```

When remove read is enabled, federation will call `q.Select(nil, mset...)`
which will break remote reads because it currently doesn't handle empty
SelectParams.

Signed-off-by: Corentin Chary <c.chary@criteo.com>
2018-06-19 13:03:01 +01:00
Simon Pasquier dacb6c530a discovery/file: fix logging (#4178)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-19 13:03:01 +01:00
Paul Gier 5c70213f9f config: set target group source index during unmarshalling (#4245)
* config: set target group source index during unmarshalling

Fixes issue #4214 where the scrape pool is unnecessarily reloaded for a
config reload where the config hasn't changed.  Previously, the discovery
manager changed the static config after loading which caused the in-memory
config to differ from a freshly reloaded config.

Signed-off-by: Paul Gier <pgier@redhat.com>

* [issue #4214] Test that static targets are not modified by discovery manager

Signed-off-by: Paul Gier <pgier@redhat.com>
2018-06-19 13:03:01 +01:00
Tom Wilkie 47809cae01
Merge pull request #4282 from prometheus/4263-remote
remote read: nil pointer deference when using remove read
2018-06-18 17:59:42 +01:00
Brian Brazil 78efdc6d6b
Avoid infinite loop on duplicate NaN values. (#4275)
Fixes #4254

NaNs don't equal themselves, so a duplicate NaN would
always hit the break statement and never get popped.

We should not be returning multiple data point for the same
timestamp, so don't compare values at all.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-06-18 17:34:08 +01:00
Tom Wilkie fcc3f43acd spelling.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-18 17:32:44 +01:00
Tom Wilkie 0b189b2da9 Review feedback.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-18 17:21:12 +01:00
Tom Wilkie ae29512444 Extend API tests to cover remote read API.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-18 17:21:12 +01:00
Corentin Chary 530107f8ef federation: nil pointer deference when using remove read
```
level=error ts=2018-06-13T07:19:04.515149169Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56202: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.516199547Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56204: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.51717692Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56206: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.564952878Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56208: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.566575791Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56210: runtime error: invalid memory address or nil pointer dereference"
level=error ts=2018-06-13T07:19:04.567106063Z caller=stdlib.go:89 component=web caller="http: panic serving [::1" msg="]:56212: runtime error: invalid memory address or nil pointer dereference"
```

When remove read is enabled, federation will call `q.Select(nil, mset...)`
which will break remote reads because it currently doesn't handle empty
SelectParams.

Signed-off-by: Corentin Chary <c.chary@criteo.com>
2018-06-18 17:21:12 +01:00
Callum Styan d0ee4da932 fix minor issues in custom SD example (#4278)
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2018-06-18 16:08:02 +01:00
Simon Pasquier 6eab4bbca1 kubernetes_sd: fix namespace filtering (#4273)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-15 09:08:14 +01:00
Fabian Reinartz e7cfc7dae5 web: restore old path prefix behavior
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-15 09:08:14 +01:00
Simon Pasquier 8cd59da857 kubernetes_sd: fix namespace filtering (#4273)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-14 15:49:43 +01:00
Alin Sinpalean 91ce63a140 Log the line when failing a PromQL test. (#4272)
Signed-off-by: Alin Sinpalean <alin.sinpalean@gmail.com>
2018-06-14 15:18:16 +01:00
Paul Gier d24d2acd11 config: set target group source index during unmarshalling (#4245)
* config: set target group source index during unmarshalling

Fixes issue #4214 where the scrape pool is unnecessarily reloaded for a
config reload where the config hasn't changed.  Previously, the discovery
manager changed the static config after loading which caused the in-memory
config to differ from a freshly reloaded config.

Signed-off-by: Paul Gier <pgier@redhat.com>

* [issue #4214] Test that static targets are not modified by discovery manager

Signed-off-by: Paul Gier <pgier@redhat.com>
2018-06-13 16:34:59 +01:00
Frederic Branczyk f77b65d430
Merge pull request #4259 from prometheus/rmsecheaders
web: remove security headers
2018-06-12 17:05:14 +02:00
Fabian Reinartz 97767eb581
Merge pull request #4256 from prometheus/routeprefix
web: restore old path prefix behavior
2018-06-12 16:23:13 +02:00
Fabian Reinartz 7a74689973
Merge pull request #4258 from prometheus/rmsecheaders
web: remove security headers
2018-06-12 16:21:35 +02:00
Fabian Reinartz 8a4bda8d57 web: remove security headers
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-12 08:59:13 -04:00
Fabian Reinartz 4d675e2aa8 web: restore old path prefix behavior
Signed-off-by: Fabian Reinartz <freinartz@google.com>
2018-06-12 08:45:43 -04:00
Simon Pasquier 0e5e7f75cd discovery/file: fix logging (#4178)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-12 12:45:59 +01:00
Henri DF a3ddde0800 Add prompb/README (#4222)
Signed-off-by: Henri DF <henridf@gmail.com>
2018-06-11 22:00:33 +01:00
Simon Pasquier 45b8dea320 Makefile: update .PHONY target (#4234)
Makefile: update .PHONY target

* Move .PHONY declarations near their targets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-11 17:51:28 +02:00
Brian Brazil 25e2d9f152
Update example console template for node exporter 0.16.0 (#4208)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-06-08 14:01:05 +01:00
Simon Pasquier e8fc6c8774 index: fix another Uvarint() return check
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-08 14:42:24 +02:00