Commit graph

7190 commits

Author SHA1 Message Date
Chris Marchbanks 1d1f64b4bc
Fix Promtool showing false duplicate rule warnings (#6270)
Alert rules do not use the Record field, so any alerts with the same
labels and different names would be counted as being duplicates.
Promtool will now consider either field when finding duplicates.

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2019-11-05 11:22:31 -07:00
Julius Volz 3836cc1997 React UI: Fix left/right icons in the time picker (#6275)
https://github.com/prometheus/prometheus/pull/6193 removed these icons
from the font library, but the non-React timepicker library requires
these.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-05 08:15:18 -07:00
Sharad Gaur e94503ff5c Head Cardinality Status Page (#6125)
* Adding TSDB Head Stats like cardinality to Status Page

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Moving mutx to Head

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Renaming variabls

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Renaming variabls and html

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Removing unwanted whitespaces

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding Tests, Banchmarks and Max Heap for Postings Stats

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding more tests for postingstats and web handler

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding more tests for postingstats and web handler

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Remove generated asset file that is no longer used

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>

* Changing comment and variable name for more readability

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Using time.Duration in postings status function and removing refresh button from web page

Signed-off-by: Sharad Gaur <sgaur@splunk.com>
2019-11-04 19:06:13 -07:00
Alex Dzyoba 1a38075f83 scrape: Move tests to testutil (#6187)
Part of the fix for #3242.

Signed-off-by: Alex Dzyoba <alex@dzyoba.com>
2019-11-04 16:43:42 -07:00
Boyko 7293c859ab pass the value to the input instead to downshift (#6235)
* pass the value to the input instead to downshift

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

* adjust expression input tests

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

* improve ExpressionInput test coverage

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-04 13:15:25 +01:00
Julius Volz 95554074d8
React UI: Support custom path prefixes (#6264)
* React UI: Support custom path prefixes

The challenge was that the path prefix can be set dynamically as a flag
on Prometheus, but the React app bundle is statically compiled in to
expect a given path prefix. By adding a placeholder value to the React
app's index.html and replacing it in Prometheus with the right path
prefix during serving, this injects Prometheus's path prefix into the
React app via a global const.

Threading the path prefix into the different React components could have
been done with React's Contexts (https://reactjs.org/docs/context.html),
but I found the consumer side of context values to be a bit cumbersome
(wrapping entire components in context consumers), so I ended up
preferring direct threading of the path prefix values to components that
needed them. Also, using contexts in tests is more verbose than just
passing in path prefix values directly.

Fixes https://github.com/prometheus/prometheus/issues/6163

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

* Review feedback

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-04 09:17:50 +01:00
Julius Volz 5bc935337a
React UI: Simpler and relative-only query URL building (#6263)
I prefer just keeping it dumb (and it helps with a current Netlify
deploy hack I have).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-03 13:21:35 +01:00
Julius Volz 8c0b76d1da
React UI: Improve styling of autocomplete sections (#6228)
* React UI: Improve styling of autocomplete sections

I removed the Card-related components and went back to normal <ul>/<li>,
since the style that Cards added just got in the way (like adding extra
borders and rounding, etc.), and from the examples at
https://getbootstrap.com/docs/4.3/components/card/, it doesn't seem like
multiple Cards are meant to be used as part of a larger list
(style-wise).

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

* Address review feedback

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-03 12:47:47 +01:00
Julius Volz fffb5ca1e9
React UI: More conversions to Function Components (#6259)
* React UI: More conversions to Function Components

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

* Address chat feedback over Riot

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-02 21:45:22 +01:00
Julius Volz f7446778f3
Document new status API endpoints (#6262)
* Document new status API endpoints

These were added in https://github.com/prometheus/prometheus/pull/6243
for the React UI.

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

* Update new-in notices

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-02 18:18:32 +01:00
Boyko cb7cbad5f9 WIP: status page - API and UI (#6243)
* status page initial commit

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

* refactor useFetch

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

* refactoring

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

* adding tests

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

* snapshot testing

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

* fix wrong go files formatting

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

* change the snapshot library

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

* update api paths

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

* move test folder outside src

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

* useFetches tests

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

* sticky navbar

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

* handle runtimeInfo error on Gather() and add json tags to RuntimeInfo struct

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

* refactor alert managers section

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-02 16:53:32 +01:00
mattrussi ca9fce46a3 Correct the docker run volume parameter (#6247)
* Fixes prometheus/docs#1418

Signed-off-by: Matt Russi <mattrussi@users.noreply.github.com>
2019-11-02 11:49:36 +01:00
Chris Marchbanks f17a0e17aa Implement the /flags page in react (#6248)
* Implement the /flags page in react

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>

* Use custom react hook for calling api

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2019-11-02 10:27:36 +01:00
Björn Rabenstein 74726367cf
Merge pull request #6254 from prometheus/beorn7/mixin
Fix the description template for PrometheusRemoteWriteDesiredShards
2019-10-30 14:44:35 +01:00
beorn7 9c8f9bfa63 Fix the description template for PrometheusRemoteWriteDesiredShards
Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-30 13:27:37 +01:00
Tariq Ibrahim 83e6d56393 clean up indirects in go.mod manifest (#6249)
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-10-30 08:50:55 +00:00
Björn Rabenstein 7c039a6b3b
Merge pull request #6242 from prometheus/beorn7/mixin
Fix PrometheusRemoteWriteDesiredShards
2019-10-29 16:01:09 +01:00
Michał 040425b0eb filtering alerts by state and display count of alerts in each state (#5758)
* local storage selectedTab on targets tab was renamed

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* added filters when displaying alerts

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* function was simplified

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* fixed rebase

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* minor rename

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* Active -> Pending

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>
2019-10-29 11:09:52 +01:00
Benoit Gagnon 6d931a2195 Fix Windows support for custom-sd adapter (#6217)
* add test to custom-sd/adapter writeOutput() function

Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>

* fix Adapter.writeOutput() function to work on Windows

On that platform, files cannot be moved while a process holds a handle
to them. Added an explicit Close() before that move. With this change,
the unit test succeeds.

Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>

* add missing dot to comment

Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
2019-10-29 10:41:31 +01:00
beorn7 61617eb2d9 Fix PrometheusRemoteWriteDesiredShards
This rule has the same labels on both sides. We don't want
`group_right` and `on`, we want nothing.

Signed-off-by: beorn7 <beorn@grafana.com>
2019-10-29 00:23:39 +01:00
Dustin Hooten e0443e6fa3 Add unit tests for react-app (#6234)
* Add MetricFormat unit tests

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add App unit tests; Add debug script

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add Checkbox unit tests

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add SeriesName unit tests

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add QueryStatsView unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add Legend unit tests

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Remove unused utils/func

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add utils/urlParams unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add utils/timeFormat unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add ExpressionInput unit tests

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add GraphControls unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add TimeInput unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add DataTable unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add SanitizeHTML unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add Graph unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Extract utils/html

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add PanelList unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add Panel unit test

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add react-ui test coverage report to CI

Signed-off-by: Dustin Hooten <dhooten@splunk.com>
2019-10-28 18:09:48 +01:00
Ben Kochie 8340db5614 Update aggregation operator docs (#6240)
Update the aggregation operator documentation.
* Include before expression style syntax as valid.
* Update examples to show before style.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-10-28 17:37:07 +01:00
CSTDev 3b39f6ae45 WIP: React UI Linting rules (#6206)
* Initial react-ui linting rules

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Add react linting to build process

Move eslint config to its own file to keep package.json clearer.

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Linting changes from master

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Move CI linting to makefile and travis

Also add trailing comma to multiline imports.

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Add lint fix target to makefile

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Lint latest master

Signed-off-by: cstdev <pietomb00@hotmail.com>
2019-10-28 15:02:42 +01:00
Julius Volz e8027ba515
React UI: Serve React UI under /new (#6229)
This makes React UI URLs look nicer than the previous
/static/graph-new/app.html, but internally still serves all React UI
files from the compiled-in static assets directory.

Also, to allow future usage of the React / Reach router, we need to
serve the main React app's index.html on certain sub-paths that
correspond to current Prometheus's UI pages, instead of trying to serve
actual files that match the provided path name.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-28 10:45:53 +01:00
Ben Kochie 3f3986ed53 Adjust React query stats font (#6238)
* Use root relative font size rather than px to avoid hidpi issues.
* Darken to 50% saturation of base font color.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-10-28 10:22:36 +01:00
Julius Volz c83094b443
React UI: Implement /config page (#6236)
* React UI: Implement /config page

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

* Address review comments

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-28 10:00:00 +01:00
Boyko 8afa8452fd reach router integration initial commit (#6232)
Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-27 22:03:39 +01:00
Julius Volz db76da7603
React UI: Fix initial setting of past queries (#6226)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-26 22:20:52 +02:00
Julius Volz 9698262b63
React UI: Simplify query history setting code (#6225)
The metric names only get loaded once initially, so there is no reason
to mix them up with the handling of ongoing query history.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-26 21:17:24 +02:00
Boyko dab87ca281 split autocomplete dropdown in to groups (#6211)
* split autocomplete dropdown in to groups

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

* fix autocomplete flickering

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

* fix expression input issue.

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

* select autocomplete item issue fix

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

* remove metric group abstraction

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-26 19:50:22 +02:00
Yao Zengzeng 1afa476b8a minor fix for making map (#6076)
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
2019-10-25 20:06:00 -06:00
Tobias Guggenmos fbcf41c90b doc: Add documentation about comments in PromQL (#6198)
* Add documentation about comments

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-10-25 11:01:59 +01:00
Julius Volz 8cf054849f
Update more web/ui/README.md bits for new UI (#6197)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-25 10:19:21 +02:00
Tobias Guggenmos fe80cf4734 promql: Eliminate dead code (#6215)
peek() already ensures to not return a ItemComment so checking for this
is redundant.

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2019-10-25 10:18:20 +02:00
Ganesh Vernekar 95d3d3f7ed
Merge pull request #6213 from prometheus/gtm-tsdb-cards
Edit TSDB README badges
2019-10-24 15:11:07 +02:00
Goutham Veeramachaneni 53a99530d6
Edit TSDB README badges
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2019-10-24 15:35:47 +05:30
Simon Pasquier 3cb0a9d955
.circleci/config.yml: cache dependencies (#6181)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-10-24 10:43:22 +02:00
Krasimir Georgiev 4fb9f1605f
disable github actions (#6207)
github actions runs the comment validation for every comment which in
turn downloads and runs a new container on every execution.

This is wasting many resources and also there is a big delay when
starting a test so need to think for a different design and for now will
disable GH actions.

An addition to this people are receiving an email for each posted
comment that fails the validation

Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
2019-10-23 23:37:53 +03:00
Boyko e235af9c47 migrate query history (#6193)
* migrate query history

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

* update lock file

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

* set expression input height when item is selected

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

* pr review changes

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-23 22:18:41 +02:00
Tariq Ibrahim 89e610ef4c bump go version in go.mod (#6194)
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-10-23 12:01:57 +01:00
CSTDev 4262ad92ce React ui add query stats (#6190)
* Adds the query stats to UI

Adds the query load time, resolution and total number of time series,
as the current UI has

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Implement unit test for QueryStats

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Tidy Query Stats component

Rename it and expose a interface for the values it displays
Make it a functional component as it has no state or lifecycle
Better null/undefined checks
Only render if needed, decided by the panel
Remove old stats if the next errors

Signed-off-by: cstdev <pietomb00@hotmail.com>
2019-10-23 12:47:37 +02:00
Callum Styan 5f1be2cf45 Refactor calculateDesiredShards + don't reshard if we're having issues sending samples. (#6111)
* Refactor calculateDesiredShards + don't reshard if we're having issues
sending samples.
* Track lastSendTimestamp via an int64 with atomic add/load, add a test
for reshard calculation.
* Simplify conditional for skipping resharding, add samplesIn/Out to shard
testcase struct.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-10-21 15:54:25 -06:00
Björn Rabenstein b5e603ceb8
Merge pull request #6119 from cstyan/rw-dashboard-shards
Add additional shards/segment graphs to remote write dashboard.
2019-10-21 21:55:38 +02:00
Julius Volz 1c238ac086
Add links between classic and new UIs (#6191)
The links preserve the graph settings between the two UIs.

Fixes https://github.com/prometheus/prometheus/issues/6162

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-21 20:18:47 +02:00
Callum Styan da6d46625f Repeat shards panels on the queue label.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-10-21 11:03:50 -07:00
Boyko b5a16a8f86 make expression input controlled (#6174)
* make expression input controlled

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

* close menu explicitly  when autosuggestion dropdown is hidden

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-20 22:52:29 +02:00
Simon Pasquier 3acc3e856c
Adding unit test for target group (#6141)
* adding unit test for target group

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

* Improve unit tests for target group

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

* Fix imports

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

* Improve test by asserting on whole Target Group object

Signed-off-by: Jean-Baptiste Le Duigou <jb.leduigou@gmail.com>
2019-10-18 16:24:26 +02:00
Simon Pasquier d2645018cf
.circleci/config.yml: fix CircleCI image tag for publish (#6179)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-10-18 16:08:26 +02:00
Hrishikesh Barman 7567376a24 replace AUTH_FILE with PROMBENCH_GKE_AUTH (#6180)
Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
2019-10-18 15:34:57 +03:00
Simon Pasquier 19ce6b7f5f
discovery: fix more error logs on context cancelation (#6133)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-10-18 11:48:51 +02:00