Commit graph

438 commits

Author SHA1 Message Date
Roman Vynar 9d616952b3
Added missed pathPrefix to Status sub-menus 2016-05-26 17:42:28 +03:00
beorn7 93460fb853 Remove a spurious "w" from _base.html 2016-05-25 13:59:50 +02:00
Bjoern Rabenstein 52a133d4d2 Make assets without debug settings 2016-05-23 11:13:08 +02:00
beorn7 da8cb10b43 Partition the status tab into items in a dropdown
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.
2016-05-18 18:13:55 +02:00
Fabian Reinartz 54de6afd22 Merge pull request #1625 from prometheus/series-api-time-bounds
Support time range in /api/v1/series endpoint.
2016-05-12 11:53:31 +02:00
Julius Volz 0c1e7a5b00 Support time range in /api/v1/series endpoint.
This adds optional "start" and "end" form values that may be used to
restrict the time range of returned series.

Fixes https://github.com/prometheus/prometheus/issues/1542
2016-05-12 07:28:02 +02:00
Steve Durrheimer 399d5c6375
Make version informations consistent between prometheus components 2016-05-05 22:33:18 +02:00
Julius Volz c78bd13a2b Include date and time in graph hover detail.
This is the same solution as applied to PromDash in
https://github.com/prometheus/promdash/pull/72.

Fixes https://github.com/prometheus/prometheus/issues/1569
2016-04-22 23:00:18 +02:00
Julius Volz c0b430b8e5 Improve before-relabeling label tooltips.
Yes, the label names and values really need double HTML escaping in
order to end up correctly in the tooltip after two levels of unescaping.

Fixes https://github.com/prometheus/prometheus/issues/1563
2016-04-18 20:23:41 +02:00
Jonathan Boulle 38098f8c95 Add missing license headers
Prometheus is Apache 2 licensed, and most source files have the
appropriate copyright license header, but some were missing it without
apparent reason. Correct that by adding it.
2016-04-13 16:08:22 +02:00
beorn7 4b574e8a61 Switch chunk encoding to type 2 where it was hardcoded type 1 before
The chunk encoding was hardcoded there because it mostly doesn't
matter what encoding is chosen in that test. Since type 1 is
battle-hardened enough, I'm switching to type 2 here so that we can
catch unexpected problems as a byproduct. My expectation is that the
chunk encoding doesn't matter anyway, as said, but then "unexpected
problems" contains the word "unexpected".
2016-03-20 23:32:20 +01:00
beorn7 836f1db04c Improve MetricsForLabelMatchers
WIP: This needs more tests.

It now gets a from and through value, which it may opportunistically
use to optimize the retrieval. With possible future range indices,
this could be used in a very efficient way. This change merely applies
some easy checks, which should nevertheless solve the use case of
heavy rule evaluations on servers with a lot of series churn.

Idea is the following:

- Only archive series that are at least as old as the headChunkTimeout
  (which was already extremely unlikely to happen).

- Then maintain a high watermark for the last archival, i.e. no
  archived series has a sample more recent than that watermark.

- Any query that doesn't reach to a time before that watermark doesn't
  have to touch the archive index at all. (A production server at
  Soundcloud with the aforementioned series churn and heavy rule
  evaluations spends 50% of its CPU time in archive index
  lookups. Since rule evaluations usually only touch very recent
  values, most of those lookup should disappear with this change.)

- Federation with a very broad label matcher will profit from this,
  too.

As a byproduct, the un-needed MetricForFingerprint method was removed
from the Storage interface.
2016-03-09 00:25:59 +01:00
beorn7 d77d625ad3 Merge branch 'master' into beorn7/storage6 2016-03-08 17:39:14 +01:00
Fabian Reinartz f2e359962c Sort exported targets 2016-03-08 17:12:27 +01:00
beorn7 f7fc542db6 Merge branch 'master' into beorn7/storage4
Conflicts:
	storage/local/persistence.go
2016-03-08 00:14:00 +01:00
Fabian Reinartz 1ede7b9d72 Consolidate TargetStatus into Target.
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.
2016-03-01 14:33:21 +01:00
beorn7 1e13f89039 Return SamplePair istead of *SamplePair consistently
Formalize ZeroSamplePair as return value for non-existing samples.

Change LastSamplePairForFingerprint to return a SamplePair (and not a
pointer to it), which saves allocations in a potentially extremely
frequent call.
2016-02-19 17:00:40 +01:00
Fabian Reinartz 37c709f917 Fix global config YAML issues 2016-02-15 14:08:25 +01:00
Fabian Reinartz 915a7c09a8 Adjust labels on status page 2016-02-15 11:10:14 +01:00
Tobias Schmidt 211cb10f13 Use https://prometheus.io 2016-02-05 00:07:03 -05:00
beorn7 a7408bfb47 Unify duration parsing
It's actually happening in several places (and for flags, we use the
standard Go time.Duration...). This at least reduces all our
home-grown parsing to one place (in model).
2016-01-29 15:41:50 +01:00
Julius Volz 1ae23bf5e9 Handle OPTIONS HTTP requests correctly.
Fixes https://github.com/prometheus/prometheus/issues/1346
2016-01-26 12:31:44 +01:00
Fabian Reinartz b0adfea8d5 Fix swapped constants, improve instrumentation 2016-01-21 12:15:29 +01:00
Fabian Reinartz 8a67110041 Revert autocomplete changes 2016-01-11 15:18:39 +01:00
Fabian Reinartz 37d80c4b25 Fix premature rule evaluation
This commit prevents rule evaluation from starting until after
the storage is ready.
2016-01-08 17:51:22 +01:00
Fabian Reinartz bf6abac8f4 Send resolved notifications 2015-12-17 15:42:26 +01:00
Fabian Reinartz 52e5224f5a Refactor rules/ package 2015-12-17 15:42:25 +01:00
Fabian Reinartz b35e25a082 Don't federate stale samples 2015-12-16 13:45:44 +01:00
Fabian Reinartz e0f70ed5ca Update common/{expfmt,model}
Closes #1232
2015-12-10 11:19:46 +01:00
Fabian Reinartz 29a69eecb8 Do not panic in Consul SD creation 2015-11-30 18:41:48 +01:00
Tobias Schmidt 7a6a0630d1 Merge pull request #1213 from prometheus/fix-wrong-http-status-codes
Return HTTP server error codes for execution errors
2015-11-12 09:12:17 -08:00
Tobias Schmidt 6c49edfce2 Merge pull request #1211 from prometheus/default-time-parameter
Make time parameter optional in v1 query API
2015-11-12 09:11:55 -08:00
Julius Volz bce5202354 Minor fixups to web/ui/README.md 2015-11-12 02:54:14 +01:00
Tobias Schmidt bf84faa010 Return HTTP server error codes for execution errors 2015-11-11 16:22:20 -08:00
Fabian Reinartz 7cbd31f7b6 Merge pull request #1212 from prometheus/uidev
Document convenient development of UI files.
2015-11-11 23:49:04 +01:00
Tobias Schmidt 50079a85a1 Make time parameter optional in v1 query API
If no time paramter is provided, the current server timestamp is used.
2015-11-11 13:30:06 -08:00
Fabian Reinartz 69e6ac735e Document convenient development of UI files. 2015-11-11 21:17:54 +01:00
Sam Starling 1901875595 Tidy up .js files based on static analysis from jshint 2015-11-11 20:06:47 +01:00
Fabian Reinartz a542cc8609 Remove -web.use-local-assets 2015-11-11 17:58:03 +01:00
Fabian Reinartz 57ca7108aa Enable debug generation of go-bindata, rename blob/ to ui/ 2015-11-11 15:55:16 +01:00
Fabian Reinartz 33aab4169c Anchor regexes in vector matching
This commit makes the regex behavior of vector matching consistent with
configuration and label_replace() by anchoring it.

Fixes #1200
2015-11-05 11:23:43 +01:00
Julius Volz a635f5451e Don't autocomplete metrics in range specifications. 2015-10-25 19:36:28 +01:00
Tobias Schmidt ee600cf949 Format web/blob/files.go after generation 2015-10-23 02:51:29 -04:00
Julius Volz c27400de21 Recompile web assets for autocomplete change. 2015-10-13 15:18:03 -04:00
Julius Volz 15c58c0f3e Enable autocomplete anywhere in expression.
This enables metric name autocompletion for every word in an expression,
not just the very first one. It would be great to also support all
language keywords during autocompletion in the future.
2015-10-13 15:17:56 -04:00
Julius Volz 0088aa4d45 Merge pull request #1132 from prometheus/fix-quoting-and-escaping
Support escape sequences in strings and add raw strings
2015-10-08 20:51:18 +02:00
Julius Volz 46c5260761 Support escape sequences in strings and add raw strings.
This adapts some functionality from the Go standard library for string
literal lexing and unquoting/unescaping.

The following string types are now supported:

Double- or single-quoted strings:

  These support all escape sequences that Go supports in double-quoted
  string literals. The difference is that Prometheus also has
  single-quoted strings (instead of single-quoted runes in Go). Raw
  newlines are not allowed.

Backtick-quoted raw strings:

  Strings quoted in backticks are treated as raw strings just like in Go
  and may contain raw newlines and other special characters directly.

Fixes https://github.com/prometheus/prometheus/issues/1122
Fixes https://github.com/prometheus/prometheus/issues/1121
2015-10-08 19:17:21 +02:00
Roy Miloh 189416cb34 Remove duplicated bootstrap js on the graph template, it's already included on the base template. 2015-10-05 22:50:16 +03:00
Fabian Reinartz e3b6ec9784 Switch to common/log 2015-10-03 10:21:43 +02:00
Julius Volz 3008a35c04 HTML-escape string return values in web UI.
Querying for the string literal "<script>alert(1)</script>" would alert
otherwise.
2015-10-01 13:21:39 +02:00
Julius Volz dac26cef71 Rename global "labels" config option to "external_labels". 2015-09-29 20:54:20 +02:00
Fabian Reinartz 398bbf906b Switch to common/route package 2015-09-24 17:08:47 +02:00
Julius Volz 0179bbfe03 Fix / -> /graph redirect when using a path prefix. 2015-09-23 12:36:18 +02:00
Björn Rabenstein cf12e890a6 Merge pull request #1098 from prometheus/fix-direct-access-of-protobuf-fields
Fix creation of protobuf fields
2015-09-21 13:40:29 +02:00
beorn7 ca63c05b4e Fix creation of protobuf fields 2015-09-18 19:00:53 +02:00
Fabian Reinartz 171f50706a Fix unkeyed field errors. 2015-09-18 17:00:08 +02:00
Fabian Reinartz ac9554539c Merge pull request #1092 from prometheus/makefile
Native go building
2015-09-18 10:29:57 +02:00
Fabian Reinartz 92ffeadb7b Move assets generation to top level make file 2015-09-17 17:53:54 +02:00
Fabian Reinartz d85cee0277 Remove compression from web interface 2015-09-17 16:33:14 +02:00
Fabian Reinartz f8a25f6af7 Apply HTTP handler compression everywhere 2015-09-17 14:49:50 +02:00
Fabian Reinartz 896928ad00 Fix redirect path 2015-09-12 09:02:34 +02:00
Fabian Reinartz d7b21f2fdb Merge pull request #1039 from prometheus/startpage
Change UI start page
2015-09-12 08:44:54 +02:00
Fabian Reinartz 87b1d47e2b Change UI start page 2015-09-12 08:40:46 +02:00
Fabian Reinartz 9bbd9264e2 Add global labels to federation 2015-09-03 16:38:03 +02:00
Julius Volz da2499d5a5 Add POST handler for /debug to fix CPU profiling.
`go tool pprof` sends a POST request to enable CPU profiling, so we also
need to handle that method.
2015-08-26 17:42:25 +02:00
Julius Volz 995d3b831d Fix most golint warnings.
This is with `golint -min_confidence=0.5`.

I left several lint warnings untouched because they were either
incorrect or I felt it was better not to change them at the moment.
2015-08-26 12:44:46 +02:00
Fabian Reinartz d6b8da8d43 Switch promql types to common/model 2015-08-25 13:49:14 +02:00
Fabian Reinartz d6d88f8950 Add missing license headers 2015-08-24 19:19:21 +02:00
Fabian Reinartz 1535ef1457 Replace metric.SamplePair with model.SamplePair 2015-08-22 14:52:35 +02:00
Fabian Reinartz 438e232c9b Fix grouping of import blocks 2015-08-22 09:42:45 +02:00
Fabian Reinartz 47aa0d536c Use common/expfmt in federation 2015-08-21 13:33:38 +02:00
Fabian Reinartz 306e8468a0 Switch from client_golang/model to common/model 2015-08-21 13:33:38 +02:00
Julius Volz 274e9d6955 Exit when web server encounters a startup error 2015-08-20 18:23:57 +02:00
Julius Volz e88007306c Remove broken alert silencing links.
Let's remove the silencing links until we actually have support for that.
A silencing link shouldn't only redirect to Alertmanager, but also open a
silencing dialog for the respective alert name or active alert element.
2015-08-18 14:48:57 +02:00
Brian Brazil eb82a4b948 web: Support multiple names for console graphs. 2015-08-11 23:37:09 +01:00
Brian Brazil a8605825a0 Rollback, meant to send a PR 2015-08-11 20:02:03 +01:00
Brian Brazil 1ad449d233 web: Support multiple names for console graphs. 2015-08-11 19:59:00 +01:00
Jan Berktold fa929a8345 Change /reload to /-/reload & and fix channel type 2015-08-11 12:26:41 +02:00
Jan Berktold 2bf7048dbb Add reload handler to web 2015-08-11 11:27:15 +02:00
Dan Williams 0441518a71 Add IDs to H2 tags to allow anchored linking
Allow sharing links directly to areas of the status page f.e. http://prometheus.internal/#config/
2015-07-30 15:39:05 -04:00
Julius Volz c5c7f92960 Fix /debug/pprof endpoint with new web router.
This got broken in
78047326b4
since it stopped using the DefaultServeMux.

This approach will defer pprof requests to the DefaultServeMux, which
may or may not have pprof enabled (in Prometheus, it gets it included in
main.go). An alternative approach would be to duplicate the four lines in
https://golang.org/src/net/http/pprof/pprof.go#L62. When choosing that
approach though, we would not automatically gain any new endpoints added
by net/http/pprof or other /debug endpoints in the future.
2015-07-22 12:28:46 +02:00
Fabian Reinartz 62b4e89b39 Restore legacy API scalar format 2015-07-16 20:19:18 +02:00
Brian Brazil 87b9813be4 Merge pull request #883 from brian-brazil/fix-menu
web: Fix regression in .Path
2015-07-10 10:38:30 +01:00
Brian Brazil 7b5a29fc8f web: Fix regression in .Path
.Path is documented as removing /consoles/,
recent changes added in a leading / which broke
the provided console templates menu system.
2015-07-10 10:31:35 +01:00
Fabian Reinartz 9e599976c4 web/js: fix display error for vectors in console 2015-07-10 00:43:43 +02:00
Fabian Reinartz 75ba840d88 web/js: adjust Javascript to new response format 2015-07-06 13:09:26 +02:00
Fabian Reinartz 3d67d75935 promql: implement JSON array format for scalar and string 2015-07-06 13:09:26 +02:00
Fabian Reinartz 77e8983221 promql: add MarshalJSON method for SamplePair 2015-07-06 10:29:59 +02:00
Julius Volz 0f57b403a9 Add tests for "globalURL" template function. 2015-07-03 14:47:52 +02:00
Julius Volz fcff35b43e Consolidate external reachability flags into one.
Besides fixing https://github.com/prometheus/prometheus/issues/805 by
making the entire externally reachable server URL configurable, this
adds tests for the "globalURL" template function and makes it easier to
test other such functions in the future.

This breaks the `web.Hostname` flag (and introduces `web.external-url`).
This flag is likely only used by few users, so I hope that's
justifiable.

Fixes https://github.com/prometheus/prometheus/issues/805
2015-07-03 13:39:10 +02:00
Fabian Reinartz 8f904d6a54 api/v1: fix response format tests 2015-07-02 14:12:26 +02:00
Fabian Reinartz b36fa7ad61 api/v1: fix Content-Type in response 2015-07-01 22:47:25 +02:00
Fabian Reinartz 4db3eeb054 web: generate embedded assets. 2015-06-25 17:26:26 +02:00
Julius Volz cf2a7a7ca9 Use v1 API for querying.
Also remove hidden input fields that are not used anymore, because the
query params are now passed as JSON to the AJAX function. This also has
the wonderful side effect that we're no longer sending all the other
non-hidden fields along to the query endpoints anymore.
2015-06-25 15:05:04 +02:00
Julius Volz 9607b8bbdb Merge pull request #840 from prometheus/fix-scrape-errors-ui
Fix blown-up scrape error display in web UI.
2015-06-24 17:55:01 +02:00
Julius Volz bc1c789bab Disallow cross-origin DELETE and POST requests. 2015-06-24 17:26:49 +02:00
Julius Volz c7039c3a73 Fix blown-up scrape error display in web UI. 2015-06-24 17:22:16 +02:00
Julius Volz 535a7f2640 Update web/blog/files.go with new web content. 2015-06-24 15:26:01 +02:00
Julius Volz bbc8b8490e Switch human-readable times to UTC.
This fixes https://github.com/prometheus/prometheus/issues/829
2015-06-23 21:26:05 +02:00
Julius Volz d868264bb8 Improve UI of /alerts page.
Changes to the UI:
- "Active Since" timestamps are now human-readable.
- Alerting rules are now pretty-printed better.
- Labels are no longer just strings, but alert bubbles (like we do on
  the status page for base labels).
- Alert states and target health states are now capitalized in the
  presentation layer rather than at the source.
2015-06-23 18:48:45 +02:00