Commit graph

7546 commits

Author SHA1 Message Date
Peter Štibraný 318cd413fc Don't return error in ContextFromRequest function.
Previously it could return error if RemoteAddr didn't
have correct format, but since this field has no specified
format, that was little too strict.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
2020-02-18 15:58:14 +01:00
Frederic Branczyk babcb86cd0
Merge pull request #6777 from prometheus/unify-interfaces
Import TSDB directly, without adapter; Unify Iterators, Querier, Series interfaces.
2020-02-18 14:51:31 +01:00
Bartlomiej Plotka 48ead578a0 Moved tsdbconfig to main.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-18 11:25:36 +00:00
Bartlomiej Plotka a20bebf7eb Moved readyStorage to main.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 8a775bc468 Moved unit agnostic options to separate pkg.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 59c9d6ef45 Addressed Brian's comments, moved metrics to main.go
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 5d84e5d895 Make chunkenc.Iterator.At behaviour unspecified without Next done.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka ad51c649b5 Fixed float conversion difference.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka cfba92a133 Addressed comments.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka c0a9ab0829 Close db properly in tests.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka fb79f515fc Fixed second bug.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka aadffd1360 Finally found a fix for the bug I was chasing for 2h...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 849faa407b Minor fixes.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 2cf637fbf5 Addressed comments.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:57 +00:00
Bartlomiej Plotka 34426766d8 Unify Iterator interfaces. All point to storage now.
This is part of https://github.com/prometheus/prometheus/pull/5882 that can be done to simplify things.
All todos I added will be fixed in follow up PRs.

* querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged
with storage interface.go. All imports that.
* querier.SeriesIterator replaced by chunkenc.Iterator
* Added chunkenc.Iterator.Seek method and tests for xor implementation (?)
* Since we properly handle SelectParams for Select methods I adjusted min max
based on that. This should help in terms of performance for queries with functions like offset.
* added Seek to deletedIterator and test.
* storage/tsdb was removed as it was only a unnecessary glue with incompatible structs.

No logic was changed, only different source of abstractions, so no need for benchmarks.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-17 18:03:54 +00:00
Harkishen Singh 489a9aa7b9
Adds normalization of localhost urls in targets page react (#6794)
* support for globalurls in targets page react

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* fixed tests

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* removed fmts

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* implemented suggestions

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* formatted

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* implemented suggestions. fixed tests.

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* formated go code

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* implemented suggestions

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>
2020-02-17 18:19:15 +01:00
Bartlomiej Plotka 88af973663
Merge pull request #6820 from codesome/break-compact
Break DB.Compact and DB.CompactHead and DB.CompactBlocks
2020-02-17 13:20:21 +00:00
Zhou Hao e628fd7735
fix comments spelling (#6829)
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-02-17 12:45:11 +01:00
Bartlomiej Plotka 384cba98fe
Merge pull request #6823 from johncming/fix-args
tsdb/wal: remove unused argument.
2020-02-16 08:25:17 +00:00
Aleksandra Gacek 8e53c19f9c discovery/kubernetes: expose label_selector and field_selector
Close #6807

Co-authored-by @shuttie
Signed-off-by: Aleksandra Gacek <algacek@google.com>
2020-02-15 14:57:56 +01:00
Grebennikov Roman b4445ff03f discovery/kubernetes: expose label_selector and field_selector
Closes #6096

Signed-off-by: Grebennikov Roman <grv@dfdx.me>
2020-02-15 14:57:38 +01:00
johncming c30abf1e2b tsdb/wal: remove unused argument.
Signed-off-by: johncming <johncming@yahoo.com>
2020-02-15 21:54:09 +08:00
Ganesh Vernekar 6f1d2ec73e
Break DB.Compact and DB.compactHead and DB.compactBlocks. Add DB.CompactHead.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2020-02-14 20:33:26 +05:30
Björn Rabenstein af04cb22c8
Merge pull request #6821 from prometheus/release-2.16
Release 2.16
2020-02-14 13:10:14 +01:00
Callum Styan b90be6f32a
Release 2.16.0 (#6817)
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2020-02-13 15:33:53 -08:00
Simon Pasquier fe76ccbfe3
discovery/consul: fix logging of tags (#6783)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-02-13 13:11:44 +01:00
Boqin Qin cdbd42393e
scrape: fix goroutine leak in test (#6812)
* scrape: fix goroutine leak in test

Signed-off-by: BurtonQin <bobbqqin@gmail.com>
2020-02-13 07:53:07 +00:00
Julien Pivotto 135cc30063
rules: Make deleted rule series as stale after a reload (#6745)
* rules: Make deleted rule series as stale after a reload

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-12 16:22:18 +01:00
Björn Rabenstein c35438f2dd
Merge pull request #6811 from pracucci/fix-remote-write-alerts
Fix queue in alerts annotation
2020-02-12 13:22:50 +01:00
Marco Pracucci 1e1785690a
Fix queue in alerts annotation
Signed-off-by: Marco Pracucci <marco@pracucci.com>
2020-02-12 12:48:13 +01:00
李国忠 3cd6a5b050
Storage concurrently tests and bug fix (#6808)
* Storage concurrently tests and bug fix

Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
2020-02-12 08:58:52 +00:00
李国忠 40dd13b074
Storage concurrently (#6770)
* Storage concurrently
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
2020-02-11 17:19:34 +00:00
Boyko 1c321ed047
React-UI: flex-wrap the content (#6796)
* flex-wrap the content

Signed-off-by: blalov <boiskila@gmail.com>

* wrap formatted series in a div

Signed-off-by: blalov <boiskila@gmail.com>
2020-02-11 15:25:39 +01:00
Nguyen Hai Truong 26574eb04d
docs: Fix typo in docs/storage.md (#6799)
`availiablity` -> `availability`

Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2020-02-10 18:32:58 +00:00
Bartlomiej Plotka 56eaaadb54
Merge pull request #6800 from prometheus/cut-v2.16.0-rc.1
Cutting v2.16.0-rc.1
2020-02-10 16:08:49 +00:00
Bartlomiej Plotka f94faafbda Cutting v2.16.0-rc.1
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-02-10 12:58:35 +00:00
Bartlomiej Plotka 32c9670b7e
Merge pull request #6793 from roidelapluie/stepinterval
promql: fix promql query log step unit
2020-02-10 12:55:20 +00:00
Bartlomiej Plotka 916e66edf2 Merge pull request #6773 from codesome/head-test
Refactor TestGCChunkAccess and TestGCSeriesAccess to create chunks by appending samples
2020-02-10 10:53:02 +00:00
helenxu1221 7df4fe3faa reset counter after collecting metric (#6798)
Signed-off-by: HelenXu <helenxu@Helens-MacBook-Pro.local>
2020-02-09 20:51:21 -07:00
Julien Pivotto ff0003e072
Make lookbackDelta a option of QueryEngine (#6746)
* Make lookbackDelta a option of QueryEngine

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* julius' suggestion

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* remove trivial getter

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Assume lookback delta is always > 0

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* add debug log

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* don't expose loopback delta

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Specify that lookack delta is also used in federation

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Fix federation test

While we have added some logic to the promql engine to keep it backwards
compatible and have a 5 minute loopback by default, the web/ package is
likely to really be internal to Prometheus and we should not add the
same kind of heuritstics here.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* loopback delta: Fix debug log

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-10 00:58:23 +01:00
Drumil Patel b00023344e
Formatting short tables for readability (#6762)
* Formatting short tables for readability

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Solving linting issues in DataTable.tsx

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Increasing maxFormattable Size to 1000 and changing value of toFormatStyle

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Solve tests failure for multiple alerts on size gretaer than 10000

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Solve linting errors

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Add tests for alert of not formatting

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
2020-02-10 00:11:57 +01:00
Julius Volz 0a8acb654e
React UI: Use null value for determining consoles link display (#6790)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2020-02-09 13:39:44 +01:00
Julien Pivotto d799078c88 also test start and end
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-08 16:42:50 +01:00
Julien Pivotto cbd0eec9fc Avoid /1000
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-08 16:30:09 +01:00
Julien Pivotto 881dde505a promql: fix promql query log step unit
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-08 16:26:56 +01:00
Drumil Patel 687a962bd1 Add conditional rendering of Navlink for Consoles (#6761)
* Add conditional rendering of Navlink for Consoles

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Replacing if else with only if conditional rendering

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Add tests and removing global declaration in Navbar

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Correct Navbar Testcases and add types for ConsolesLink

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Change names for Console link as per-naming convention

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>

* Change prop names to AppProps and NavbarProps respectively

Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
2020-02-08 11:00:47 +01:00
Julien Pivotto 40b66d29ff
OpenMetrics parse: avoid setting prev token (#6781)
We can avoid setting a prev token in the OM parser. The previous
coundition that checked for prev was unreacheable.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-07 07:33:26 +00:00
Andrew Hayworth a336908678
Adds link to valid metric names (#6774)
One of our users today asked us if dashes were allowed in recording rule names.
We asserted that they were not, but also that we could not remember for certain.
After determining empirically that they are _not_ allowed, I realized that the
documentation could be slightly clearer about valid rule names.

This PR simply adds a note to the documentation re-iterating that the rules must
be valid metric names - and more importantly, adds a link to where a user can
read what those *are*, in case they were not aware (or did not know where to find it).

Signed-off-by: Andrew Hayworth <ahayworth@gmail.com>
2020-02-07 07:32:15 +00:00
Ben Ye 1a18594176
keep kubernetes metrics in global vars (#6765)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-02-06 15:52:57 +00:00
Ganesh Vernekar bc6fd96979
Refactor TestGCChunkAccess and TestGCSeriesAccess to create chunks by appending samples
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2020-02-06 18:26:18 +05:30