Commit graph

7257 commits

Author SHA1 Message Date
Callum Styan 5830e03691
Merge pull request #6337 from cstyan/rw-log-replay
Log the start and end of the WAL replay within the WAL watcher.
2019-12-03 13:24:26 -08:00
Boyko 315b28439f Graph multi series select (#6391)
* adding graph series multi select support

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

* skip inital plot draw from ResizeDetector

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

* fix unit tests

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

* extract Legend as component

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

* create legend state interface

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

* fix click selection issue

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

* fix single series select bug

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

* review changes

Signed-off-by: blalov <boiskila@gmail.com>
2019-12-03 20:20:45 +01:00
Frederic Branczyk 8ac15703b0
Merge pull request #6393 from simonpasquier/fix-kubernetes-client-metrics
discovery/kubernetes: fix client metrics
2019-12-03 14:46:10 +01:00
Brooks Swinnerton 0ea3a2218d Add time units to storage.tsdb.retention.size flag (#6365)
* Add time units to storage.tsdb.retention.size flag

In an effort to reduce confusion with the `m` option of the
`ParseDuration()` function, this commit adds the available time units to
the `storage.tsdb.retention.time` flag to help showcase that there is no
option for months (which could be assumed to be `m`).

If someone were looking to set the retention to six months, they may
mistakenly do so with `6m`, which would reduce their retention to six
minutes.

Signed-off-by: Brooks Swinnerton <bswinnerton@gmail.com>
2019-11-30 08:00:51 +00:00
Simon Pasquier 75470f86b4 discovery/kubernetes: fix client metrics
The Kubernetes client records workqueue duration and latency metrics as
seconds so there's no need to convert the values from microseconds to
seconds anymore.

The cache metrics (prometheus_sd_kubernetes_cache_*) are removed because
they aren't used anymore by the client though still exposed by its API.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-11-29 12:34:36 +01:00
Bartlomiej Plotka eba5e02718 Volunteering for release shepharding (#6384)
(:

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
2019-11-27 11:45:23 -07:00
Boyko 28470c229c React UI: Graph refactoring (#6382)
* move graph related files into own folder

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

* move graph helper functions into own file

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

* fix typo in file name

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

* fix typo in file name and lint fixes

Signed-off-by: blalov <boiskila@gmail.com>
2019-11-27 16:51:40 +01:00
Tobias Guggenmos 408574a6e1 promql: Allow injecting fake tokens into the generated parser (#6381)
* promql: Allow injecting fake tokens into the generated parser

Yacc grammars do not support having multiple start symbols.

To work around that restriction, it is possible to inject fake tokens into the lexer stream,
as described here https://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html .

This is part of the parser rewrite effort described in #6256.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-27 12:59:03 +00:00
Callum Styan 6a24eee340 Simplify duration check for watcher WAL replay.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-11-26 16:53:11 -08:00
Boyko fa1489e35c React UI: Improve graph legend hover performance (#6367)
* improve hover performance

Signed-off-by: blalov <boyko.lalov@tick42.com>

* increase graph tests coverage

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

* wrap plotSetAndDraw into requestAnimationFrame to achieve smooth hover effect

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

* unit tests

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

* add destroy plot method to types

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

* make chart undefined by default

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

* make destroy plot test more meaningful

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

* remove chart.destroy extra check

Signed-off-by: Boyko Lalov <boiskila@gmail.com>
2019-11-26 20:48:53 +01:00
Tobias Guggenmos bbd92b85da promql: Use capitalized names for item types (#6371)
For yacc generated parsers there is the convention to capitalize the names of item types provided by the lexer, which makes it easy to distinct lexer tokens (capitalized) from nonterminal symbols (not capitalized) in language grammars.

This convention is also followed by the (non generated) go compiler (see https://golang.org/pkg/go/token/#Token).

Part of the parser rewrite described in #6256.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-26 13:29:42 +00:00
Tobias Guggenmos c229ed17e2 promql: Implement yyLexer interface (#6370)
This is the first step towards a generated lexer as described in #6256.

It adds methods to the parser struct, that make it implement the yyLexer interface required by a yacc generated parser, as described here: https://godoc.org/golang.org/x/tools/cmd/goyacc .

The yyLexer interface is implemented by the parser struct instead of the lexer struct for the following reasons:

* Both parsers have a lookahead that the lexer does not know about. This solution makes it possible to synchronize these lookaheads when switching parsers.
* The routines to handle parser errors are not accessible to the lexer.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-26 13:28:36 +00:00
Björn Rabenstein bd1c66861a
Merge pull request #6350 from geobeau/fix-exported-relabel
Fix relabaling collision when using exported labels
2019-11-26 13:19:18 +01:00
Geoffrey Beausire 5cb7987314 Fix relabaling collision when using exported label
When using both a label and the suffix+label in the
relabel config. It's possible that Prometheus remove
the suffx+label for no obvious reason. It's due to a
collision when merging labels from target and from
the sample.

Signed-off-by: Geoffrey Beausire <g.beausire@criteo.com>
2019-11-26 11:03:11 +01:00
Bartosz Jakubski 80ba03c67d fix subquery with offset conversion to string (#6373)
Signed-off-by: Bartosz Jakubski <b.jakubski@gmail.com>
2019-11-26 06:45:51 +00:00
Callum Styan c2cb1e4103 Add a metric to track total bytes sent per remote write queue. (#6344)
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-11-25 13:25:18 -07:00
Julius Volz 4be90b201e
Remove Travis as a CI platform (#6369)
It's currently causing weird unknown problems in React tests that run
successfully everywhere else, and by now all the tests that run on
Travis also run on CircleCI, so Travis is not needed anymore.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-25 14:59:26 +01:00
Tobias Guggenmos c63259b83c promql: Clean up parser struct (#6360)
* promql: Clean up parser struct

The parser struct used two have two somewhat misused fields:

peekCount int
token     [3]item

By reading the code carefully one notices, that peekCount always has the value 0 or 1 and that only the first element of token is ever accessed.

To make this clearer, this commit replaces the token array with a single variable and the peekCount int with a boolean.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-25 12:29:14 +00:00
Julius Volz 9497764011
Update remote storage maintainers to Callum and Chris (#6366)
* Update remote storage maintainers to Callum and Chris

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Chat feedback

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-25 12:58:44 +01:00
Tobias Guggenmos d0cff29749 PromQL: Reduce Code duplication in AST traversion (#6362)
* promql: Add Children function for easier AST traversion

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-25 11:41:59 +00:00
Ganesh Vernekar 66dd5df3d8
Merge pull request #6368 from ntk148v/correct-max-block-duration
Correct the default max block duratioh value
2019-11-25 12:21:54 +08:00
Kien Nguyen 34e2f15e18 Correct the default max block duratioh value
The default value is 31 days [1]

[1] https://github.com/prometheus/prometheus/blob/master/cmd/prometheus/main.go#L312

Signed-off-by: Kien Nguyen <kiennt2609@gmail.com>
2019-11-25 11:12:26 +07:00
Boyko 731ca08acd React UI: Graph legend (#6321)
* initial commit

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* eslint fixes

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* hover bug fix

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* refactoring

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* remove unnecessary check

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix tests

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* lint fix

https://github.com/prometheus/prometheus/issues/6268
Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix typos

Fixes<https://github.com/prometheus/prometheus/issues/6268>

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* init hover events if can

Fixes: <https://github.com/prometheus/prometheus/issues/6268>

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* review changes

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix activeIndex bug

Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* extend plot options types

Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* adding more types

Signed-off-by: blalov <boyko.lalov@tick42.com>

* fix branch after wrong force push

Signed-off-by: blalov <boyko.lalov@tick42.com>

* unit test fixes

Signed-off-by: blalov <boyko.lalov@tick42.com>

* remove unused variables

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-24 13:14:57 +01:00
Julius Volz cb92a45bf3
React UI: Make test spy attachment more jest-y (#6361)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-24 13:14:01 +01:00
Julius Volz d2a3ef2f12
Remove broken Travis badge (#6364)
The "green" status of this badge was actually last updated 4 years ago,
until I manually ran a master branch test today that made the current
Travis test failures in the React tests visible. But those test failures
seem to be Travis-related and not real (the same tests pass on
CircleCI). Maybe we can completely remove Travis by now, but let's
remove the now-failing badge for now to not scare users.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-23 23:13:40 +01:00
Julius Volz 22d884b38e
React UI: Fix tests harder (#6316)
* React UI: Fix tests harder

Again not sure why this passed last time (?), but now I was getting an
error about 'NaN' not being a valid value to assign to the 'height'
property of the input element. This changes it so that only the blur()
function is actually mocked out on the active input element.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fixup

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-22 16:20:07 +01:00
Julius Volz 20ec57160c
React UI: Clarify VSCode usage requirements (#6357)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-22 14:55:32 +01:00
Tobias Guggenmos ac3932ea35 Improve PromQL parser performance by making it non-concurrent (#6356)
Before this commit, the PromQL parser ran in two goroutines:
* The lexer goroutine that splits the input into tokens and sent them over a channel to
* the parser goroutine which produces the abstract syntax tree

The Problem with this approach is that the parser spends more time on goroutine creation
and syncronisation than on actual parsing.

This commit removes that concurrency and replaces the channel by a slice based buffer.

Benchmarks show that this makes the up to 7 times faster than before.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-21 18:43:09 +00:00
Dipack P Panjabi e2dd5b61ef Added CreateBlock and CreateHead functions to new file (#6331)
* Added CreateBlock and CreateHead functions to new file to make it reusable across packages.

Signed-off-by: Dipack P Panjabi <dipack.panjabi@gmail.com>
2019-11-21 19:10:25 +07:00
Callum Styan 7bf17b654c As per dev summit, SD moratorium has been lifted. (#6324)
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-11-21 00:22:15 +00:00
Julius Volz d2cb05846b
React UI: Add /tsdb-status to React-handled routes (#6313)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-20 15:50:52 +01:00
Boyko 3e3b7ceb0b React UI: Change the dynamic react key with static id (#6325)
* change the dynamic key with static id for react key prop

Signed-off-by: blalov <boyko.lalov@tick42.com>

* test fix

Signed-off-by: blalov <boyko.lalov@tick42.com>

* add initial panel on did mount

Signed-off-by: blalov <boyko.lalov@tick42.com>

* lint fix

Signed-off-by: blalov <boyko.lalov@tick42.com>

* remove filter for empty expression

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactoring

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor encodePanelOptionsToQueryString

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor encodePanelOptionsToQueryString

Signed-off-by: blalov <boyko.lalov@tick42.com>

* revert to format range/endTime

Signed-off-by: blalov <boyko.lalov@tick42.com>

* urlParams unit tests

Signed-off-by: blalov <boyko.lalov@tick42.com>

* unit tests adjustments

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-20 15:33:03 +01:00
Julien Pivotto 2a190d1168 Fix small typo in docs (#6345)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-11-20 10:12:47 +01:00
Björn Rabenstein ba9332972c
Merge pull request #6335 from cstyan/rw-dashboard-simplify
Simplify remote write dashboard in mixin.
2019-11-20 02:43:26 +01:00
Callum Styan 2d3ce3916c Log the start and end of the WAL replay within the WAL watcher.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-11-19 14:21:13 -08:00
Tim Bart 2e77f3a52b Fix typo in posting stats. (#6343)
Signed-off-by: Tim Bart <tbart@cloudflare.com>
2019-11-19 21:03:24 +00:00
shreyassrivatsan e825282dd1 Add exemplar support to the openmetrics parser (#6292)
* Add exemplar support to the openmetrics parser

Signed-off-by: Shreyas Srivatsan <shreyas@chronosphere.io>
2019-11-19 09:33:30 +00:00
johncming ad4bc5701e remove unwanted break (#6338)
Signed-off-by: johncming <johncming@yahoo.com>
2019-11-18 23:01:03 -08:00
Callum Styan f4fb6dc208 Simplify remote write dashboard in mixin.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-11-18 19:58:07 -08:00
akerele abraham 9d39fdad0c unittest: check for rule files existence (#6075)
Signed-off-by: akerele abraham <abrahamakerele38@gmail.com>
2019-11-18 13:54:52 -08:00
Tom Wilkie de0a772b8e Port tsdb to use pkg/labels. (#6326)
* Port tsdb to use pkg/labels.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Get tests passing.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Remove useless cast.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Appease linters.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

* Fix review comments

Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2019-11-18 11:53:33 -08:00
naivewong 23c0299d85 [tsdb] Improve mergeSeriesSet (#5920)
* refactor and simplify mergeSeriesSet

Signed-off-by: naivewong <867245430@qq.com>
2019-11-15 21:45:29 +07:00
Jean-Baptiste Le Duigou 5973227434 adding additional unit tests for getDataCenter() in consul (#6192)
* adding additional unit tests for getDataCenter() in consul

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Consult Tests : update comments to start with uppercase and end with point

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Consult Test : using table-driven tests

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Consul Test : cleaner syntax

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Consul Test : even cleaner syntax

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Consul Test : update comments

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Fixing naming convention by removing underscore in function name

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>

* Removing duplicated test case for getDatacenter()

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>
2019-11-15 14:52:39 +01:00
Björn Rabenstein 9f35c75c21
Merge pull request #6323 from prometheus/beorn7/build
Add tsdb/tsdb to .gitignore
2019-11-15 14:51:15 +01:00
beorn7 c09a6cf169 Add tsdb/tsdb to .gitignore
This is built this way by the Makefile. One might ask if that's the
correct location for the `tsdb` tool or if it should be placed
top-level together with `prometheus` and `promtool`. But for now, it
should be excluded from Git like the latter two.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-11-15 12:41:37 +01:00
Julius Volz 85cae37107
React UI: Add better docs for the React UI (#6315)
* React UI: Add better docs for the React UI

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fixups

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fixup

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-14 19:53:10 +01:00
Julius Volz 2a6df53416
React UI: Make link to classic UI work (#6320)
It being a Reach Router <Link> caused the Reach router to not actually
leave the React app, even though the destination path was not a path
handled by the Reach Router.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-14 18:46:39 +01:00
Julius Volz 8ee3b8c848
React UI: Fix "<path-prefix>/new" -> "<path-prefix>/new/" redirect (#6319)
Fixes https://github.com/prometheus/prometheus/issues/6163

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-14 14:58:22 +01:00
Tobias Guggenmos be2bcc50a2 Fix target metadata API for empty match_targets (#6303)
According to the documentation, the target metadata API accepts it,
if no value for match_target has been provided. This was not the case
in the implementation.

This commit make the API behave as described in the docs.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-11-14 12:09:44 +01:00
Boyko 12d347e4db unit test fixes (#6314)
Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-13 14:58:45 +01:00