- input key handler causes 2 layout cycles on each keypress which can
clog up browser rendering when typing quickly
- this change adds a debounce to the key press handler of 500ms
Fixes#5308
Signed-off-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
1. Added an ability to resize text area on mouseclick
2. Remember selected target status button on page reload
Signed-off-by: Maria Nemtinova <nemtinovamasha@gmail.com>
* web: updated bootstrap3-typeahead file to work with bootstrap 4.0.0
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: Replaced bootstrap-3.3.1 with bootstrap 4.0.0
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: Added bootstrap4-glyphicons as 4.0.0 doesnt include bootstrap3 glyphicons
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated js jquery to 3.3.1
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated _base.html to import new bootstrap 4.0.0, jquery3.3.1 and bootstrap class tags to be 4.0 compatible
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: _base.html missed word out in title tag (Server).
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated alerts.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated config.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated flags.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated service-discovery.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated status.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated targets.html class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: updated graph_template.handlebar class names and tags to be bootstrap 4 compatible.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: alerts.css fix for button color inheritance on alerts page.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: graph.css fix for color inheritance.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: prometheus.css updated to fix nav bar.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* web: previous merge conflict not fixed correctly on _base.html
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* menu.lib and prom.lib imports updated
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* bootstrap 4.1.3 imported
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Bootstrap 4.1.3 imported into _base.html
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* bootstrap 4.1.3 imported into prom.lib
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* menu.lib style adjusted to view sidebar
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Alert colour uplifted to bootstrap 4.1.3
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Alerts display code reformatted similarly to config
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Consoles pages adjusted to account for new navbar
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* LHS Menu fixed in console pages
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Minor changes to prom_console to adjust lhs nav
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Prom.lib and some css updated to fix console graph controls
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Bootstrap 4.0.0 files removed
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Consoles configured so that the graph fits with the new side bar, css files also adjusted
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Import popper.min.js for dropdowns
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Popper.min.js imported locally
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Re-added #4764 and fixed css
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Removed .DS_Store
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Rebuilt assets
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* Spaces between buttons and inputs on graph page removed
Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>
* fixed spacing in buttons on /targets
Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>
* Updated vfsdata.go
Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>
* fixed typeahead issue
Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
* added css for dropdown
Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
* changed order of css imports
Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
* tinkered with CSS changes to make keyboard select and mouseover match
Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
* added `Copy to clipboard` button
Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
* generate vsfdata
Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
* new lines
Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
* single newline
Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
When a metric has a null value, number formatters like
`humanizeNoSmallPrefix` will throw "Uncaught TypeError: Cannot read
property 'toPrecision' of null".
This is fixed by explicitly checking for `null` and returning the string
"null".
Note: This is usually not seen as rickshaw doesn't show annotations for
null values, but still calls the formatter.
Signed-off-by: David Coles <coles.david@gmail.com>
* web: added ability to set page title through flag.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* Reformatted variable names and Flag description for readability.
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* assets_vfsdata.go
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* Flag name changed from web.ui-title to web.page-title
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* make assets
Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
* *: move to go 1.11
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Reduce number of places where we specify the Go version
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Add evaluationTimestamp (Last Evaluation) column to display on /rules
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Add lastScrapeDuration ("Scrape Duration") to display on /targets
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Updates based on Julius' feedback
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Update to set timestamp to when eval started (after eval completes)
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Update /rules to display time since last evaluation
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
* Re-order Last Eval/Eval Time to be consistent with targets page
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
With the addition of the errors in the views list, it is now difficult
to have a view on all the rules in a screen witdh.
This commit adds wrapping to improve the overall display of the rules
page.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
Looking at https://tech.townsourced.com/post/embedding-static-files-in-go/ (which was mentioned in the issue), vfsgen has all the needed features.
In particular:
- Reproducible builds (no issue with timestamping).
- Well maintained and relatively popular.
- Integration with go generate.
- Self-contained (no external dependency).
* [WIP] Replace go-bindata by vfsgen
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Add license + remove doc.go
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Generate templates assets
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Use new templates assets
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* split static assets
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Idempotent make assets
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Update vendor/
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* vendor vfsgendev
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Update README.md
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Simplify assets generation
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Fix README.md
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Use generate helper program instead of vfsgen
This avoids installing vfsgendev in the target environment.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Remove unused vfsgen package
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Fix Makefile
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* vendoring shurcooL/vfsgen
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Fix go generate command
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Sync web/ui/assets_vfsdata.go
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* adding information about the health and errors for Rules
adding Health() and LastError() to the Rule interface. This will allow
us to easily surface information about rules.
Signed-off-by: noqcks <benny@noqcks.io>
* updating rules.html with fields for Rule errors and health state
Signed-off-by: noqcks <benny@noqcks.io>
* fix code comment grammar & access Rule health/error info using a mutex
Signed-off-by: noqcks <benny@noqcks.io>
* s/Errors/Error/ in rules.html to remain consistent with targets.html
Signed-off-by: noqcks <benny@noqcks.io>
* adding periods to code comments in reporting/alerting
Signed-off-by: noqcks <benny@noqcks.io>
* putting health/error below mutex in struct field
Signed-off-by: noqcks <benny@noqcks.io>
Displaying all the dropped targets in the service-discovery page hurts
the Prometheus server as well as the browser when thousands of dropped
targets exist. This change limits this number to 1,000 and display the
number of active/total targets per scrape configuration.
Add warning when more than 100 targets are dropped
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
After removing the checkbox in #3913 the only remaining element that
looked like it was the new Show Annotations checkbox on the Alerts page.
Which in turn didn't look like the Enable query history checkout on the
graph page. So:
1. This takes the Enable query history button as canonical.
2. Updates the show annotations button code to match it.
3. Simplifies the JS for the checkbox.
The new Service Discovery page uses the CSS/JS from the Targets page but
used slightly differently. This makes the job header match in the
Service Discovery page for a more consistent look-n-feel.
* Added only healthy to Targets
This adds a "Only heathly" button to supplement the "Only unhealthy"
button. The two are mutually exclusive.
I've also added a red/green text color to the buttons.
Arguably this could be a toggle instead if folks think this is
worthwhile... Happy to modify it.
* Moved functions above init
* Simplifed code and made prettier
* Appeased codeacy
* Made buttons square
* Fix JS error: cannot read source of undefined
When the page was refreshed with queries on the page,
the updateTypeaheadMetricsSet function was called before
the typeahead had been initialized.
* Fix: updates URL when query submits
When queries were submitted by pressing enter, the URL did not update
to reflect the change. Not sure why, but this was only the case when
the queries were non-simple, meaning when either labels werre specified
or other promql functions were used.
* Rebase master and make assets
This is a very minor UX change. The current "No Alert rules" present
table row has the `alert_header` class attached. This changes the cursor
and some other stuff and makes sense with the populated table but less
sense with the unpopulated table. So removing it the latter case.
When you have no alerting rules defined you get a screen sharing this
information in the WebUI. If no rules are defined then you instead see
an empty white screen. This adds a "No rules" defined `else` clause and
a `Rules` header to the page.
* Do not autoselect the first item in the dropdown
* Historical queries only show in dropdown when toggled on
* Move shared behavior to queryHistory.isEnabled function
* Do not auto submit selected history queries
When there is an empty result set, the Prometheus server replies with
{"status":"success","data":{"resultType":"vector","result":null}}
That "null" reply was not handled correctly by the graphing library.
This commit handles that case and shows "no data" in the UI console view
instead of throwing an error in the browser javascript console.
Fixes#3515
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Add UI warning for time drift >30 seconds
* Yellow time drift warning & better warning message
* Set warning threshold to 30 sec
* Include changed assets
No matter how we refactor docs, `/docs/` will stay the prefix, so there's not long-term risk in changing this.
One we version docs, we should probably try and keep link & version in sync.
Issue #3046 is triggered by html/template changes in go1.9.
See https://tip.golang.org/pkg/html/template. Quote:
// To ease migration to Go 1.9 and beyond, "html" and "urlquery" will
// continue to be allowed as the last command in a pipeline. However, if the
// pipeline occurs in an unquoted attribute value context, "html" is
// disallowed. Avoid using "html" and "urlquery" entirely in new templates.
The commit also includes a trivial whitespace fix.
Expose buildQueryUrl, refactor dispatch to use
buildQueryUrl will allow users to execute queries over the range of an
existing graph. This will be helpful to select data series they wish to
annotate the graph with, for example.
The fuzzy library didn't try to find a "best match", but settled on the
first fuzzy match that exists. This patch includes a modified version of
the fuzzy library, which recursivley tries on the rest of the search
string to find a better match. If found, returns that one.
Another small modification is that if a pattern fully matches, it
skips the lookup entirley and returns the highest score possible for
that match.
For some of the queries, the fuzzy lookup was not filtering properly.
The problem is due to the "replace" beind made on the query itself. It
accidently removes only the first underscore. This patch changes it so
that it removes all of the whitespaces, letting the fuzzy algorithm do
its magic, also fixing this problem.
Originally, the underscore were replaced by a space for this specific
reason, to let the user type a space and have the lookup treat it as the
word break.
Fixes#2380
Adds also the moment.js library, which is a dependency of it.
Following conventions in the web/ui directory, I am not including the original
sources or LICENSE files.
If an existing request is aborted due to a new request, ignore the completion of the initial request.
Example:
1. Chrome dev tools: enable 5 second network latency
2. Execute query
3. A second later, execute the query again
4. Currently, the spinner will hide, and the stats will immediately display, as if the request had completed. Instead, the spinner and stats should wait until the 2nd execution finishes.
* Add fuzzy search to /graph textarea
We have a few thousands different metrics and looking up some of them
can be quite annoying with the simple string matching.
This patch adds a fuzzy search to the textarea lookup box on the /graph
page. It uses a small neat library from github.com/mattyork/fuzzy.
* Add fuzzy lib to NOTICE and re-build assets
Previously built assets changed the mode.
If an existing request is aborted due to a new request, ignore the completion of the initial request.
Example:
1. Chrome dev tools: enable 5 second network latency
2. Execute query
3. A second later, execute the query again
4. Currently, the spinner will hide, and the stats will immediately display, as if the request had completed. Instead, the spinner and stats should wait until the 2nd execution finishes.
This reverts commit aa43d34a86.
This brings back the /graph changes so that @grandbora can continue to
work on the redirect for backwards compatibility. And other changes
can already take the new /graph parameters into account.
This revert will be reverted once v1.1 is released and has its own
release branch. Since we had already change on top of this, there was
no cleaner way of cutting those changes out.
This commit reverts the following commits:
Revert "Update backend helpers and templates to new url schema"
This reverts commit fc6cdd0611.
Revert "Refactor graph.js"
This reverts commit 445fac56e0.
Revert "Use query parameters in the url"
This reverts commit 3e18d86d8a.
Revert "Point to correct place for GraphLinkForExpression"
This reverts commit 3da825fc76.
Assets are also updated.
There's no corresponding table column for this table header. The
placeholder link for silences was removed in e8800730.
Accordingly, regenerate `web/ui/bindata.go` by running:
make assets format
I got feedback from different sources about rules and targets being
too heavy in the status tab if their are lots of them.
This change also allows for more fine-granular locking.
This commit simplifies the TargetHealth type and moves the target
status into the target itself. This also removes a race where error
and last scrape time could have been out of sync.