Commit graph

2557 commits

Author SHA1 Message Date
Harmen
512b3f8d95 Friendlier message when there are no alerting rules 2016-07-27 12:54:46 +02:00
Matt Bostock
78715e4182 Alerts template: remove silence table header
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
2016-07-26 21:33:21 +01:00
Harmen
afc5873b0e don't store empty values in the URL 2016-07-25 21:08:05 +02:00
Julius Volz
3bfec97d46 Make the storage interface higher-level.
See discussion in
https://groups.google.com/forum/#!topic/prometheus-developers/bkuGbVlvQ9g

The main idea is that the user of a storage shouldn't have to deal with
fingerprints anymore, and should not need to do an individual preload
call for each metric. The storage interface needs to be made more
high-level to not expose these details.

This also makes it easier to reuse the same storage interface for remote
storages later, as fewer roundtrips are required and the fingerprint
concept doesn't work well across the network.

NOTE: this deliberately gets rid of a small optimization in the old
query Analyzer, where we dedupe instants and ranges for the same series.
This should have a minor impact, as most queries do not have multiple
selectors loading the same series (and at the same offset).
2016-07-25 13:59:22 +02:00
beorn7
1bb077b5ef Merge branch 'release-1.0' into beorn7/release 2016-07-21 14:55:05 +02:00
beorn7
4ff4857112 Recreate assets 2016-07-21 14:11:09 +02:00
Brian Brazil
56151e57ba Update example console templates to new HTTP API.
Fixes #1819
2016-07-21 14:01:09 +02:00
Brian Brazil
9e58070c04 Merge pull request #1820 from prometheus/console-api
Update example console templates to new HTTP API.
2016-07-18 21:59:21 +01:00
Brian Brazil
d458ecd4b9 Update example console templates to new HTTP API.
Fixes #1819
2016-07-18 20:36:47 +01:00
Dmitry Vorobev
273e457da4 web: return status code and error message for config resource 2016-07-15 10:15:24 +02:00
Fabian Reinartz
59d26e8536 web: add -web.route-prefix flag
Fixes #1191
2016-07-07 11:49:16 +02:00
Fabian Reinartz
62af249d06 Merge pull request #1761 from prometheus/fabxc-legacyapi
api: drop legacy API
2016-06-27 14:26:03 +02:00
Fabian Reinartz
425736a377 *: remove last remainers of non-second metrics 2016-06-23 17:50:39 +02:00
Fabian Reinartz
97f62c021e api: drop legacy API 2016-06-23 17:14:32 +02:00
Brian Brazil
4dbe689632 Do our own date parsing in console template graph controls.
Fixes #1442
2016-06-10 10:23:40 +01:00
Fabian Reinartz
25135c3691 web: round last scrape timestamp to milliseconds 2016-06-08 20:23:54 +02:00
David Gstir
2dd80225a4 Fix JS XHR requests in prom_console.js on IE11
IE11 does not support automatic JSON parsing for responses with
xhr.responseType = 'json', so we have to to do it manually.
2016-06-01 19:44:04 +02:00
Julius Volz
194a486c60 Merge pull request #1660 from alileza/add_http_errorlog
Log HTTP server errors using common/log
2016-05-26 15:03:15 -05:00
Ali Reza
624717e801 Log HTTP server errors using common/log
change naming to be more descriptive.
Fixes #1651

remove pointer receiver

use common/log error logger
2016-05-27 00:20:40 +07:00
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
Julius Volz
d7ea0397d4 Use templates.TemplateExpander for all page templates.
This will allow us to use all of our shiny templating functions in the
main page templates as well.
2015-06-23 17:53:06 +02:00
Fabian Reinartz
53b9d5917d web: improve target URL handling and display. 2015-06-23 13:45:15 +02:00
Fabian Reinartz
39a8254963 web: add basic federation support.
This commit adds a federation handler on /federate. It accepts `match[]`
query parameters containing vector selectors. Their intersection determines
the in-memory metrics that are returned in the same way as the
/metrics endpoint does (modulo sorting).
2015-06-23 13:45:15 +02:00
Fabian Reinartz
1eff186555 Merge pull request #810 from prometheus/fabxc/lmatch
Match empty labels.
2015-06-22 15:45:50 +02:00
Fabian Reinartz
5b91ea9b36 storage: improve label matching and allow unset matching.
Matching of empty labels now also matches metrics where the label
was not explicitly set to the empty string.
2015-06-22 15:33:44 +02:00
Fabian Reinartz
94cd321be1 promql: error if all label matchers are empty. 2015-06-22 15:33:44 +02:00
Fabian Reinartz
119801027f web: expose a version information endpoint 2015-06-17 14:49:31 +02:00
Fabian Reinartz
39edc2df7a version: move version information into separate package.
Version information is determined at build-time and thus there is
no need to pass it down from main. In its own package it can
be used from various other packages.
2015-06-16 14:48:29 +02:00
Fabian Reinartz
85d7c7640a web: remove flags, refactor handlers 2015-06-15 19:01:06 +02:00
Brian Brazil
27ef54263e Web: Format files.go when it is built.
This will avoid unrelated changes appearing
when you do a make fmt
2015-06-13 15:27:08 +01:00
Julius Volz
b9b20fd80e Always show selected range, regardless of returned data. 2015-06-12 17:22:06 +02:00
Julius Volz
395a0b3b11 Merge pull request #799 from prometheus/multiline-expr-input
Change expression input field to multi-line textarea.
2015-06-12 17:03:54 +02:00
Julius Volz
8bb578c1fe Change expression input field to multi-line textarea.
Also, rearrange and clean up some things to make this work.
The textarea starts as a single line, but auto-expands when entering
multiple lines (e.g. via Shift+Enter). Pressing just "Enter" still
executes the expression.
2015-06-12 16:59:38 +02:00
Fabian Reinartz
8d304d95e5 make: do not call go-bindata on building. 2015-06-12 09:29:37 +02:00
Fabian Reinartz
70e0be6295 Merge pull request #783 from prometheus/fabxc/api-v1-ext
/series endpoints for API v1 and scalar range queries
2015-06-11 14:06:04 +02:00
Fabian Reinartz
7bb7e565a4 web/api: add GET and DELETE /series endpoints 2015-06-11 12:24:57 +02:00
Sindre Myren
a081c9436b Building without a Makefile (on Windows)
Main changes:

- Switched to using `go-bindata` in place of `scripts/embed-static.sh`.
- Support for building Prometheus without a `Makefile`.
- Minor typo fix to make Prometheus build on Windows (without Makefiles).

Please note that this does not mean that prometheus will work on Windows.
There are still failing tests!
2015-06-10 20:43:59 +02:00
Fabian Reinartz
7be94ce962 web/api: improve errors, add tests 2015-06-10 18:36:02 +02:00
Fabian Reinartz
75b0b7420e web/api: replace /metrics/names with /label/:name/values endpoint. 2015-06-08 23:10:52 +02:00
Fabian Reinartz
ae01a5366d Merge pull request #774 from prometheus/fabxc/api-v1
Initial API v1 implementation
2015-06-08 19:14:25 +02:00
Fabian Reinartz
5b713911e3 web/api: enable running API legacy and v1 in parallel 2015-06-08 19:11:48 +02:00
Julius Volz
adf6850853 Improve display of target labels on status page.
Instead of a "{...}"-style list, show key/value pairs as Bootstrap
labels.
2015-06-08 16:12:58 +02:00
Julius Volz
51653e7890 Merge pull request #779 from prometheus/fabxc/rule-cleanup
rule cleanup
2015-06-08 15:12:47 +02:00
Brian Brazil
b8b1d3cbac Web: Add pre-relabel labels to status page.
Figuring out what's going on with the new service discovery
and labels is difficult. Add a popover with the labels
to the target table to make things simpler, and help
discovery of potentially useful labels.
2015-06-08 12:19:01 +01:00
Fabian Reinartz
ab9c98acac web/api: add initial API v1 implementation. 2015-06-06 21:47:36 +02:00
Fabian Reinartz
5e13880201 General cleanup of rules. 2015-06-06 21:40:52 +02:00
Fabian Reinartz
e88e5f680b web: simplify prefix handling using util/route package. 2015-06-03 15:53:04 +02:00
Fabian Reinartz
78047326b4 web: cleanup initialization of web service. 2015-06-03 08:45:43 +02:00
Fabian Reinartz
280d11dca8 main: exit on invalid rule files on startup. 2015-06-02 18:44:41 +02:00
Fabian Reinartz
0de6edbdfc Move pkg/ to util/ 2015-06-01 21:12:32 +02:00
Fabian Reinartz
027d8968d5 Move embed-static.sh into scripts folder 2015-06-01 21:12:32 +02:00
Fabian Reinartz
f45a5cab60 Move templates package to pkg/template 2015-06-01 21:12:31 +02:00
Fabian Reinartz
dfaf31a1da Move web/httputils to pkg/httputil and add DeadlineClient to it 2015-06-01 21:12:31 +02:00
Julius Volz
09fcf505f5 Fix slash position in MustBuildServerURL(). 2015-06-01 12:54:19 +02:00
Julius Volz
d7c015c149 Convert pathPrefix to not have trailing slash. 2015-06-01 12:43:17 +02:00
Julius Volz
837ffcea29 Merge pull request #726 from prometheus/improve-redirections
Improve web redirection and 404 behavior.
2015-05-23 16:16:26 +02:00
Tobias Gesellchen
84d42f48e5 allow to override the default os.Hostname() when creating PrometheusURLs 2015-05-23 12:59:38 +02:00
Julius Volz
fcd33bbfd8 Improve web redirection and 404 behavior.
Previously we redirected any non-existent path to the root (or path
prefix).

The new behavior:

With no path prefix:

- "" -> "/"
- "/biz" -> 404

With path prefix of "/foo/bar":

- "" -> "/foo/bar/"
- "/" -> "/foo/bar/"
- "/foo/bar" -> "/foo/bar/"
- "/biz" -> /foo/bar/biz"
  (anything not starting with the path prefix gets the prefix prepended)
- "/foo/bar/biz" -> 404
2015-05-23 12:46:16 +02:00
Björn Rabenstein
c44e7cd105 Merge pull request #706 from prometheus/beorn7/persistence2
Improve iterator performance.
2015-05-21 13:48:52 +02:00
beorn7
3b9c421a69 Weed out all the [Gg]et* method names.
The only exception is getNumChunksToPersist to avoid naming the struct
member numChunksToPersist in a weird way.
2015-05-20 19:13:06 +02:00
Julius Volz
267fd34156 Switch Prometheus to use github.com/prometheus/log.
This change is conceptually very simple, although the diff is large. It
switches logging from "github.com/golang/glog" to
"github.com/prometheus/log", while not actually changing any log
messages. V(1)-style logging has been changed to be log.Debug*().
2015-05-20 18:19:32 +02:00
Fabian Reinartz
e2ed921505 Merge branch 'master' into fabxc/servdisc 2015-05-20 14:13:08 +02:00
Fabian Reinartz
a216b1cb27 Merge pull request #704 from prometheus/fabxc/cfg_check
Clean storage shutdown on startup errors, require initial config
2015-05-19 16:50:05 +02:00
Fabian Reinartz
ec9c51ab98 Fix old template naming 2015-05-19 15:40:41 +02:00
Fabian Reinartz
5d3024fd3e Restructure component initialization 2015-05-19 14:41:47 +02:00
Mitsuhiro Tanda
3e914a8cb1 fix graph links with path prefix 2015-05-19 02:45:05 +09:00
Fabian Reinartz
385919a65a Avoid inter-component blocking if ingestion/scraping blocks.
Appending to the storage can block for a long time. Timing out
scrapes can also cause longer blocks. This commit avoids that those
blocks affect other compnents than the target itself.
Also the Target interface was removed.
2015-05-18 17:58:51 +02:00
Fabian Reinartz
1a2d57b45c Move template functionality out of target.
The target implementation and interface contain methods only serving a
specific purpose of the templates. They were moved to the template
as they operate on more fundamental target data.
2015-05-18 13:35:43 +02:00
Fabian Reinartz
dbc08d390e Move target status data into its own object 2015-05-18 11:15:42 +02:00
Fabian Reinartz
bb540fd9fd Implement config reloading on SIGHUP.
With this commit, sending SIGHUP to the Prometheus process will reload
and apply the configuration file. The different components attempt
to handle failing changes gracefully.
2015-05-13 16:49:46 +02:00
Fabian Reinartz
3b0777ff84 Merge branch 'master' into fabxc/servdisc 2015-05-12 15:46:16 +02:00
Fabian Reinartz
eeca323d24 Merge branch 'master' into promql 2015-05-06 13:04:54 +02:00
Fabian Reinartz
6649306e63 Merge pull request #660 from prometheus/fabxc/pql/parse-errs
Fix and improve parsing error output.
2015-04-30 13:31:13 +02:00
Fabian Reinartz
279831cdf1 Fix and improve parsing error output. 2015-04-30 12:19:39 +02:00
Fabian Reinartz
8d7c479fed Merge pull request #658 from prometheus/fabxc/pql/rules-manager
Rename RuleManager to Manager, remove interface.
2015-04-29 16:54:21 +02:00
Fabian Reinartz
479891c9be Rename RuleManager to Manager, remove interface.
This commits renames the RuleManager to Manager as the package
name is 'rules' now. The unused layer of abstraction of the
RuleManager interface is removed.
2015-04-29 16:42:10 +02:00
Fabian Reinartz
25cdff3527 Remove name arg from Parse* functions, enhance parsing errors. 2015-04-29 16:38:41 +02:00
Fabian Reinartz
3ca11bcaf5 Switch Prometheus to promql package.
This commit removes all functionality from rules/ that is now handled in
promql/.
All parts of Prometheus are changed to use the promql/ package.
2015-04-28 16:19:23 +02:00
Fabian Reinartz
5015c2a0e8 Make target manager source based.
This commit shifts responsibility for maintaining targets from providers and
pools to the target manager. Target groups have a source name that identifies
them for updates.
2015-04-24 15:49:35 +02:00
Brian Brazil
c3a2b63fe9 Add stddev and stdvar aggregation functions.
This adds the population standard deviation and
variance as aggregation functions, useful for
spotting how many standard deviations some samples
are from the mean.
2015-04-17 00:30:03 +01:00
Ceesjan Luiten
6f5f33bd4d #625 Fix incorrect consoles URL 2015-04-06 17:30:13 +02:00
Ceesjan Luiten
0e18784c64 Make all paths absolute to support proxies 2015-04-02 20:36:47 +02:00
Julius Volz
33702da8a8 Use simple Now() func in API instead of utility.Time. 2015-03-27 23:43:47 +01:00
Julius Volz
a5a553f1da Add initial HTTP API tests.
This covers the /query (instant query) endpoint for now. Others to
follow.
2015-03-27 21:37:55 +01:00
Julius Volz
3f2686d0b3 Remove unused fields from MetricsService. 2015-03-27 18:51:13 +01:00
Julius Volz
c8a6b73bff Merge pull request #606 from prometheus/custom-instant-timestamps
Allow custom timestamps in instant query API.
2015-03-27 18:31:51 +01:00
Julius Volz
c9b76def4c Report all query API HTTP errors in JSON format. 2015-03-27 16:48:03 +01:00
Julius Volz
ea8a12db59 Also fix label HTML-escaping in console graphs. 2015-03-22 23:47:00 +01:00
Julius Volz
8f6ef04d70 HTML-escape label values in Rickshaw hover-detail. 2015-03-22 21:59:14 +01:00
Julius Volz
df314ead84 Remove unnecessary "else" branch in query API. 2015-03-21 17:54:30 +01:00
Julius Volz
a68b880c27 Add tests for new timestamp/duration functions.
...and fix the first bugs in them where they truncate precision below a
second.
2015-03-21 17:50:45 +01:00
Julius Volz
cb816ea14a Improve timestamp/duration parsing in query API.
Don't handle `0` as a special timestamp value for "now" anymore, except
in the `QueryRange()` case, where existing API consumers still expect
`0` to mean "now".

Also, properly return errors now for malformed timestamp/duration
float values.
2015-03-21 16:58:45 +01:00
Julius Volz
8a4acefd66 Allow custom timestamps in instant query API. 2015-03-20 23:10:58 +01:00
Julius Volz
c78436d707 Remove unused API time dependency injection. 2015-03-20 23:10:26 +01:00
Björn Rabenstein
942686427d Merge pull request #596 from prometheus/beorn7/ingestion-tweaks
Remove the ingestion channel.
2015-03-19 17:56:55 +01:00
Julius Volz
6fa510d6fa More fixes around special values in graphs. 2015-03-19 14:26:25 +01:00
beorn7
fa1935a644 Remove /api/targets call and do not show job and instance labels on status.
/api/targets was undocumented and never used and also broken.

Showing instance and job labels on the status page (next to targets)
does not make sense as those labels are set in an obvious way.

Also add a doc comment to TargetStateToClass.
2015-03-18 18:53:43 +01:00
beorn7
be11cb2b07 Remove the sample ingestion channel.
The one central sample ingestion channel has caused a variety of
trouble. This commit removes it. Targets and rule evaluation call an
Append method directly now. To incorporate multiple storage backends
(like OpenTSDB), storage.Tee forks the Append into two different
appenders.

Note that the tsdb queue manager had its own queue anyway. It was a
queue after a queue... Much queue, so overhead...

Targets have their own little buffer (implemented as a channel) to
avoid stalling during an http scrape. But a new scrape will only be
started once the old one is fully ingested.

The contraption of three pipelined ingesters was removed. A Target is
an ingester itself now. Despite more logic in Target, things should be
less confusing now.

Also, remove lint and vet warnings in ast.go.
2015-03-15 14:08:22 +01:00
Julius Volz
91da12ad6a Show special float values as gaps. 2015-03-13 21:08:22 +01:00
Julius Volz
52ce3599c9 Nicer formatting of target health table on /status. 2015-03-07 23:35:28 +01:00
juliusv
5a4fe403ff Merge pull request #514 from prometheus/fix-graph-js-errors
Fix graph JS glitches and simplify graphing code.
2015-02-09 13:17:28 +01:00
Julius Volz
989bc86bcb Make flag names consistent across projects. 2015-02-08 23:29:57 +01:00
Tobias Schmidt
655dffe393 Update help URL 2015-02-07 05:10:12 -05:00
Julius Volz
0229a89925 Fix graph JS glitches and simplify graphing code.
- original series data is saved so it can be re-transformed after
  Rickshaw's stacking modified the series data

- always reconstruct graphs from scratch instead of updating the
  settings of an existing one (simplification)

- always wipe and recreate all graph-related DOM elements completely so
  that no left-over event handlers cause background event handlers
2015-02-06 23:51:37 +01:00
Julius Volz
0e8c0b67ad Remove custom hover flip code. Fixed upstream. 2015-02-06 15:02:13 +01:00
Julius Volz
517a731ebf Show unlimited number of metrics in autocomplete. 2015-02-06 02:03:08 +01:00
juliusv
9e6b3bcefa Merge pull request #498 from fabxc/feature/query_timeout
Implement query timeouts
2015-02-03 13:51:47 +01:00
Fabian Reinartz
fa1e90003b Query timeout added.
This is related to #454. Queries now timeout after a duration set by
the -query.timeout flag. The TotalEvalTimer is now started/stopped
inside any of the ast.Eval* functions.
2015-02-03 08:04:27 +01:00
Julius Volz
b3978fe869 Fix Rickshaw/D3 version mismatch.
When Rickshaw was updated to 1.5.1 in
fd43daf82e,
the Rickshaw upstream package now contained 3 different D3 files:

d3.min.js
d3.v2.js
d3.v3.js

For details on why that is, see
https://groups.google.com/forum/#!topic/d3-js/lXQgKA7mtEw

For the 1.5.1 Rickshaw to work properly (being able to format dates with
D3 without causing a JS error), it needs d3.v2.js or d3.v3.js, not the
d3.min.js one. I chose to update us to d3.v3.js now, since that is the
most recent and minified version, and I didn't see any problems with it
(also, the current Rickshaw examples are using that D3 version).

Currently, displaying graphs with a range >14d is broken. This fixes
that.
2015-02-02 23:41:36 +01:00
Bjoern Rabenstein
f568bbc19f Improve comments about embedding. 2015-02-02 12:37:39 +01:00
Tobias Schmidt
edadba3b25 Merge web/blob/Makefile into web/Makefile
While the recent commit 7e5745f solved the issue of having an
independent blob-stamp file, which was possible to become out of
sync with the necessary web/blob/files.go file, this change further
simplifies the setup by merging the two Makefile.
The only purpose of web/Makefile was to call targets in
web/blob/Makefile. As all dependencies for blob/files.go are
outside of the blob/ directory, the separation isn't logically
necessary.
2015-01-29 19:12:32 -05:00
Björn Rabenstein
855f20a4d3 Merge pull request #470 from prometheus/beorn7/slim-static-assets
Slim down the files we embed into the binary.
2015-01-26 15:24:15 +01:00
Bjoern Rabenstein
3fc354c4ce Update help link. 2015-01-26 15:18:43 +01:00
Bjoern Rabenstein
7e5745fe0e Slim down the files we embed into the binary.
- Use only the minified versions of bootstrap.

- Do not embed non-minified bootstrap files and bootstrap map files.

- Simplify the 'blob-stamp' Makefile contraption.
2015-01-26 15:10:27 +01:00
Julius Volz
d4374a9265 More efficient JSON query result format.
This depends on https://github.com/prometheus/client_golang/pull/51.

For vectors, the result format looks like this:

```json
{
   "version": 1,
   "type" : "vector",
   "value" : [
      {
         "timestamp" : 1421765411.045,
         "value" : "65.475000",
         "metric" : {
            "quantile" : "0.5",
            "instance" : "http://localhost:9090/metrics",
            "job" : "prometheus",
            "__name__" : "http_request_duration_microseconds",
            "handler" : "/static/",
            "method" : "get",
            "code" : "304"
         }
      },
      {
         "timestamp" : 1421765411.045,
         "value" : "5826.339000",
         "metric" : {
            "quantile" : "0.9",
            "instance" : "http://localhost:9090/metrics",
            "job" : "prometheus",
            "__name__" : "http_request_duration_microseconds",
            "handler" : "prometheus",
            "method" : "get",
            "code" : "200"
         }
      },
      /* ... */
   ]
}
```

For matrices, it looks like this:

```json
{
   "version": 1,
   "type" : "matrix",
   "value" : [
      {
         "metric" : {
            "quantile" : "0.99",
            "instance" : "http://localhost:9090/metrics",
            "job" : "prometheus",
            "__name__" : "http_request_duration_microseconds",
            "handler" : "/static/",
            "method" : "get",
            "code" : "200"
         },
         "values" : [
            [
               1421765547.659,
               "29162.953000"
            ],
            [
               1421765548.659,
               "29162.953000"
            ],
            [
               1421765549.659,
               "29162.953000"
            ],
            /* ... */
         ]
      }
   ]
}
```
2015-01-26 13:06:22 +01:00
Brian Brazil
2b07cd3875 Keep total counter outside out loop.
This was causing only the last expression to be graphed.
2015-01-26 10:51:38 +00:00
juliusv
351a1eb96b Merge pull request #457 from brian-brazil/bootstrap3
Adjust for bootstrap3. Remove long lists from LHS menu.
2015-01-22 15:24:58 +01:00
Brian Brazil
2d8bfa0ced Adjust for bootstrap3. Remove long lists from LHS menu.
Put in a table on the node page instead.
2015-01-22 14:23:22 +00:00
Björn Rabenstein
edc91cbabb Merge pull request #456 from prometheus/beorn7/license-cleanup
Clean up license issues.
2015-01-22 14:32:37 +01:00
Stuart Nelson
8ada6360ef Add floats to align inputs, and clear the float on the parent. 2015-01-22 13:27:35 +01:00
Bjoern Rabenstein
5859b74f1b Clean up license issues.
- Move CONTRIBUTORS.md to the more common AUTHORS.
- Added the required NOTICE file.
- Changed "Prometheus Team" to "The Prometheus Authors".
- Reverted the erroneous changes to the Apache License.
2015-01-21 20:07:45 +01:00
Julius Volz
4133020de1 Align graph controls with graph edge. 2015-01-20 16:43:23 +01:00
Julius Volz
12a99ab5b4 Some more UI/JS fixes/cleanups. 2015-01-19 14:27:07 +01:00
Julius Volz
013c22ca01 Adjust input group margins for more equal spacing. 2015-01-19 14:15:37 +01:00
Julius Volz
170da9460d Focus/typeahead fix. 2015-01-19 13:33:56 +01:00
Julius Volz
d96d4933d9 Complete Bootstrap 3 conversion.
- use the autocomplete plugin from
  https://github.com/bassjobsen/Bootstrap-3-Typeahead
- use native Bootstrap tabs
- make everything look much nicer (hopefully)
- other minor fixes/additions
2015-01-19 01:29:30 +01:00
Julius Volz
ff5eeb49fa Fix datepicker timezone issues. 2015-01-14 15:09:58 +01:00
Stuart Nelson
97ad5d3d1b Update jquery and jquery-ui. 2015-01-12 16:37:25 +01:00
Stuart Nelson
5cd8030c37 Include bootstrap.js.min 2015-01-12 16:37:13 +01:00
Stuart Nelson
8d7581d8c4 Add datetimepicker css. 2015-01-12 14:26:09 +01:00
Stuart Nelson
0529e3fcfa Use datetimepicker. 2015-01-12 14:18:28 +01:00
Stuart Nelson
2d5c2c5726 style rickshaw legend 2015-01-09 14:27:58 +01:00
Stuart Nelson
3814daac48 Make Loadtime/ Resolution info look nicer. 2015-01-09 14:23:09 +01:00
Stuart Nelson
071d98f3d0 Square corners 2015-01-09 14:23:00 +01:00
Stuart Nelson
7b9bf8d3e5 Query header. 2015-01-09 14:12:52 +01:00
Stuart Nelson
46f7bd2820 graph controls 2015-01-09 13:55:01 +01:00
Julius Volz
8ce89f0086 WIP: Upgrade to Bootstrap 3. 2015-01-09 10:15:56 +01:00
Brian Brazil
ffa2e73803 Fix regression from 5e8d57bec1
0 is a false value, so shortcutting no longer works.
Update other places in the code that assumed graph was the default.
2014-12-27 00:28:36 +00:00
Brian Brazil
fd43daf82e Upgrade rickshaw to v1.5.1
This includes better handling for missing data points in stacked graphs.
2014-12-26 14:44:06 +00:00
Julius Volz
cc27fb8aab Rename remaining all-caps constants in AST layer.
Change-Id: Ibe97e30981969056ffcdb89e63c1468ea1ffa140
2014-12-25 01:30:47 +01:00
juliusv
401decc847 Merge pull request #428 from brian-brazil/sample-consoles
Console templating library, including graphs.
2014-12-18 17:59:54 +01:00
Brian Brazil
43b105d32d Console templating library, including graphs.
This provides the basic js, css and console template
templates required to build dashboards.
Included as an example are consoles for the node_exporter.

Change-Id: I4cfeea5e9691a9413f74ae98ca32a908df8e4a59
2014-12-18 16:54:31 +00:00
Johannes 'fish' Ziemke
ff95a52b0f Rename Address to URL
The "Address" is actually a URL which may contain username and
password. Calling this Address is misleading so we rename it.

Change-Id: I441c7ab9dfa2ceedc67cde7a47e6843a65f60511
2014-12-18 12:18:16 +01:00
Bjoern Rabenstein
39efe6358b Fix typos and import order.
This doesn't make the import order consistend everywhere, just where
it was touched by the previous commit.

Change-Id: I82fc75f8691da9901c7ceb808e6f6fe8e5d62c0e
2014-12-10 17:46:56 +01:00
Bjoern Rabenstein
b1e4956142 Apply a giant code cleanup.
Essentially:

- Remove unused code.

- Make it 'go vet' clean. The only remaining warnings are in generated code.

- Make it 'golint' clean. The only remaining warnings are in gerenated code.

- Smoothed out same minor things.

Change-Id: I3fe5c1fbead27b0e7a9c247fee2f5a45bc2d42c6
2014-12-10 16:16:49 +01:00
Julius Volz
af8c6df94d Eliminate modal alerts in graphing UI.
This shows errors in a pane under the expression input instead.

Change-Id: Iec209e1628a3b102cce9f34b2467621772dfb8ff
2014-11-25 17:13:04 +01:00
Julius Volz
5e8d57bec1 Make tabular view the default (vs. graphing view).
Change-Id: I9f0961f2c474e8cce5e376ce4e20040644f89370
2014-11-25 17:13:04 +01:00
Julius Volz
3d47f94149 Drop metric names after transformations.
After many transformations, it doesn't make sense to keep the metric
names, since the result of the transformation is no longer that metric.
This drops the metric name after such transformations and makes the web
UI deal well with missing metric names.

This depends on the current branch on the following things:

- prometheus/client_golang needs to be at
  e237cf15c6
  in branch "julius/int-fingerprints" (to be merged with new storage)

- prometheus/promdash needs to be at
  dd7691c9c2

Change-Id: Ib3c8cad8d647d9854e8c653c424b8c235ccc231d
2014-11-25 17:13:04 +01:00
Bjoern Rabenstein
14bda4180c Changes after pair code review.
Change-Id: Ib72d40f8e9027818cfbbd32a7a7201eebda07455
2014-11-25 17:12:59 +01:00
Bjoern Rabenstein
006b5517e2 Simplify makefiles.
This removes the dependancy on C leveldb and snappy.
It also takes care of fewer dependencies as they would
anyway not work on any non-Debian, non-Brew system.

Change-Id: Ia70dce1ba8a816a003587927e0b3a3f8ad2fd28c
2014-11-25 17:10:39 +01:00
Julius Volz
c3fcea45e3 Support finer time resolutions than 1 second.
Change-Id: I4c5f1d6d2361e841999b23283d1961b1bd0c2859
2014-11-25 17:09:04 +01:00
Brian Brazil
f114bbd4e7 Make query_range more robust.
Gracefully handle decimal values, by truncating them.

Limit amount of steps, to avoid accidentally pulling too much data.
This limit returns up to ~500kB per timeseries, and allows
for 60s granularity for a week and 1h granularity for a year.

Change-Id: Ie549fc24deb2eecbc6c5d1b6088a548a6b02e849
2014-11-25 17:09:04 +01:00
Brian Brazil
75e37db55b Don't alert() when a query is aborted,
such as when you change the range.

Change-Id: I574504f97446ac5f3dda737fe054ae83f17dbbc2
2014-11-25 17:09:04 +01:00
Brian Brazil
fd34e4061d Add back consoles link.
Goes in index.html in consoles or else user data, if present.

Change-Id: I5303d30aa24ca0c20d2e0f49121e04a260b9c4f4
2014-11-25 17:08:26 +01:00
Andres Suarez
e389e63684 Focus expression after selection from dropdown
Change-Id: Id7f67e558e3611ab4c7188cc428c342d8d3e67db
2014-11-25 17:08:26 +01:00
Andres Suarez
86a447fc0e Allow selecting metric from Insert Metric
Change-Id: I99e0539cab2749a8aeabc0a13015889ff45834f7
2014-11-25 17:08:26 +01:00
Bjoern Rabenstein
71206dbc06 More code cleanups.
Add license text everywhere.
And others....

Change-Id: I11ccde267a2ef7eb366c4788ba7aeae14ba7545c
2014-11-25 17:07:44 +01:00
Bjoern Rabenstein
f5f9f3514a Major code cleanup.
- Make it go-vet and golint clean.
- Add comments, TODOs, etc.

Change-Id: If1392d96f3d5b4cdde597b10c8dff1769fcfabe2
2014-11-25 17:02:53 +01:00
Julius Volz
e7ed39c9a6 Initial experimental snapshot of next-gen storage.
Change-Id: Ifb8709960dbedd1d9f5efd88cdd359ee9fa9d26d
2014-11-25 17:02:00 +01:00
Brian Brazil
4a2b96f848 Remove backoff on scrape failure.
Having metrics with variable timestamps inconsistently
spaced when things fail will make it harder to write correct rules.

Update status page, requires some refactoring to insert a function.

Change-Id: Ie1c586cca53b8f3b318af8c21c418873063738a8
2014-11-25 17:02:00 +01:00
Brian Brazil
f525ca5d9e Let consoles get graph links from experssions.
Rename ConsoleLinkFromExpression, as we now have consoles.

Change-Id: I7ed2c9c83863adb390b51121dd9736845f7bcdfc
2014-11-25 17:01:59 +01:00
Brian Brazil
eba205fcac Expose path used to get to console to console.
Change-Id: I72386a2d4e53863da302ecc5c7e44d6c310197e0
2014-11-25 17:01:59 +01:00
Brian Brazil
eb5d928da7 Fix console handler.
This was accidnetally broken in 2128d9d811.

Change-Id: I50ea1fdb8ae4d28ae4555410bee97e5037692aa5
2014-11-25 17:01:59 +01:00
Julius Volz
21cafe6cd7 Only evict memory series after they are on disk.
This fixes the problem where samples become temporarily unavailable for
queries while they are being flushed to disk. Although the entire
flushing code could use some major refactoring, I'm explicitly trying to
do the minimal change to fix the problem since there's a whole new
storage implementation in the pipeline.

Change-Id: I0f5393a30b88654c73567456aeaea62f8b3756d9
2014-11-25 17:01:59 +01:00
Bjoern Rabenstein
8956faeccb Migrate to new client_golang.
This change will only be submitted when the new client_golang has been
moved to the new version.

Change-Id: Ifceb59333072a08286a8ac910709a8ba2e3a1581
2014-11-25 17:01:59 +01:00
Brian Brazil
e27447da5c Remove the broken "User Dashboard" link.
Due to the lack of a </a>, this makes the entire header render badly.
Accordingly it's safe to assume noone is using it, so remove it.
With the new console template support, we'll need to something a bit
more nuanced later.

Change-Id: I3424bed6aea18cbd4c63ad48f98808098dadc3ad
2014-11-25 17:01:59 +01:00
Brian Brazil
960ede66dc Use html/template for console templates and add template libary support.
Add a function to bypass the new auto-escaping.
Add a function to workaround go's templates only allowing passing in one argument.

Change-Id: Id7aa3f95e7c227692dc22108388b1d9b1e2eec99
2014-11-25 17:01:59 +01:00
Brian Brazil
0f5874ff97 Make Prometheus in header link to status page.
This is consistent with alertmanager, and more intiutive for users.

The graphs page just has graphs, so remove mention of consoles.

Change-Id: I87780a4ade33697a6095423e1a7de47d341d2838
2014-11-25 17:01:59 +01:00
Brian Brazil
1828b1f55c Only log every query when debugging.
Change-Id: I4f988d81cda6f6deb0ed7f497de4aa75409b158f
2014-11-25 17:01:59 +01:00
Brian Brazil
e041c0cd46 Add console and alert templates with access to all data.
Move rulemanager to it's own package to break cicrular dependency.
Make NewTestTieredStorage available to tests, remove duplication.

Change-Id: I33b321245a44aa727bfc3614a7c9ae5005b34e03
2014-05-30 16:24:56 +01:00
Julius Volz
01f652cb4c Separate storage implementation from interfaces.
This was initially motivated by wanting to distribute the rule checker
tool under `tools/rule_checker`. However, this was not possible without
also distributing the LevelDB dynamic libraries because the tool
transitively depended on Levigo:

rule checker -> query layer -> tiered storage layer -> leveldb

This change separates external storage interfaces from the
implementation (tiered storage, leveldb storage, memory storage) by
putting them into separate packages:

- storage/metric: public, implementation-agnostic interfaces
- storage/metric/tiered: tiered storage implementation, including memory
                         and LevelDB storage.

I initially also considered splitting up the implementation into
separate packages for tiered storage, memory storage, and LevelDB
storage, but these are currently so intertwined that it would be another
major project in itself.

The query layers and most other parts of Prometheus now have notion of
the storage implementation anymore and just use whatever implementation
they get passed in via interfaces.

The rule_checker is now a static binary :)

Change-Id: I793bbf631a8648ca31790e7e772ecf9c2b92f7a0
2014-04-16 13:30:19 +02:00
Matt T. Proud
2064f32662 Clean up quitting behavior and add quit trigger.
The closing of Prometheus now using a sync.Once wrapper to prevent
any accidental multiple invocations of it, which could trigger
corruption or a race condition.  The shutdown process is made more
verbose through logging.

A not-enabled by default web handler has been provided to trigger a
remote shutdown if requested for debugging purposes.

Change-Id: If4fee75196bbff1fb1e4a4ef7e1cfa53fef88f2e
2014-04-15 21:40:04 +02:00
Julius Volz
cc04238a85 Switch to new "__name__" metric name label.
This also fixes the compaction test, which before worked only because
the input sample sorting was accidentally equal to the resulting on-disk
sample sorting.

Change-Id: I2a21c4b46ba562424b27058fc02eba84fa6a6006
2014-03-14 16:52:37 +01:00
Julius Volz
740d448983 Use custom timestamp type for sample timestamps and related code.
So far we've been using Go's native time.Time for anything related to sample
timestamps. Since the range of time.Time is much bigger than what we need, this
has created two problems:

- there could be time.Time values which were out of the range/precision of the
  time type that we persist to disk, therefore causing incorrectly ordered keys.
  One bug caused by this was:

  https://github.com/prometheus/prometheus/issues/367

  It would be good to use a timestamp type that's more closely aligned with
  what the underlying storage supports.

- sizeof(time.Time) is 192, while Prometheus should be ok with a single 64-bit
  Unix timestamp (possibly even a 32-bit one). Since we store samples in large
  numbers, this seriously affects memory usage. Furthermore, copying/working
  with the data will be faster if it's smaller.

*MEMORY USAGE RESULTS*
Initial memory usage comparisons for a running Prometheus with 1 timeseries and
100,000 samples show roughly a 13% decrease in total (VIRT) memory usage. In my
tests, this advantage for some reason decreased a bit the more samples the
timeseries had (to 5-7% for millions of samples). This I can't fully explain,
but perhaps garbage collection issues were involved.

*WHEN TO USE THE NEW TIMESTAMP TYPE*
The new clientmodel.Timestamp type should be used whenever time
calculations are either directly or indirectly related to sample
timestamps.

For example:
- the timestamp of a sample itself
- all kinds of watermarks
- anything that may become or is compared to a sample timestamp (like the timestamp
  passed into Target.Scrape()).

When to still use time.Time:
- for measuring durations/times not related to sample timestamps, like duration
  telemetry exporting, timers that indicate how frequently to execute some
  action, etc.

*NOTE ON OPERATOR OPTIMIZATION TESTS*
We don't use operator optimization code anymore, but it still lives in
the code as dead code. It still has tests, but I couldn't get all of them to
pass with the new timestamp format. I commented out the failing cases for now,
but we should probably remove the dead code soon. I just didn't want to do that
in the same change as this.

Change-Id: I821787414b0debe85c9fffaeb57abd453727af0f
2013-12-03 09:11:28 +01:00
Conor Hennessy
eba01d1119 Remove usage of gorest.
Due to on going issues, we've decided to remove gorest. It started with gorest
not being thread-safe (it does introspection to create a new handler which is
an easy process to mess up with multiple threads of execution):
    https://code.google.com/p/gorest/issues/detail?id=15
While the issue has been marked fixed, it looks like the patch has introduced
more problems than the original issue and simply doesn't work properly.
I'm not sure the behaviour was thought through properly. If a new instance is
needed every request then a handler-factory is needed or the library needs to
set expectations about how the new objects should interact with their
constructor state.
While it was tempting to try out another routing library, I think for now
it's better to use dumb vanilla Go routing. At least until we decide which
URL format we intend to standardize on.

Change-Id: Ica3da135d05f8ab8fc206f51eeca4f684f8efa0e
2013-10-23 14:19:14 +02:00
Julius Volz
a50ee8df30 Always set CORS headers at beginning of API handler.
Change-Id: Icde9a74260c4bb919f09c3e10c6dd5f372ccdaec
2013-10-16 15:59:47 +02:00
Matt T. Proud
4a87c002e8 Update low-level i'faces to reflect wireformats.
This commit fixes a critique of the old storage API design, whereby
the input parameters were always as raw bytes and never Protocol
Buffer messages that encapsulated the data, meaning every place a
read or mutation was conducted needed to manually perform said
translations on its own.  This is taxing.

Change-Id: I4786938d0d207cefb7782bd2bd96a517eead186f
2013-09-04 17:13:58 +02:00
Julius Volz
788587426b Make scrape timeouts configurable per job.
Change-Id: I77a7514ad9e7969771f873d63d6353ec50082a62
2013-08-19 12:21:47 +02:00
Matt T. Proud
972e856d9b Kill the curation state channel.
The use of the channels for curation state were always unidiomatic.

Change-Id: I1cb1d7175ebfb4faf28dff84201066278d6a0d92
2013-08-13 17:20:22 +02:00
Julius Volz
0003027dce Add needed trailing spaces in logs. 2013-08-12 18:22:48 +02:00
Julius Volz
aa5d251f8d Use github.com/golang/glog for all logging. 2013-08-12 17:54:36 +02:00
Julius Volz
ecf0ee8f39 Transfer alerting rule and Prometheus URL to alertmanager. 2013-08-09 18:32:13 +02:00
Matt T. Proud
07ac921aec Code Review: First pass. 2013-08-05 17:31:49 +02:00
Matt T. Proud
d8792cfd86 Extract HighWatermarking.
Clean up the rest.
2013-08-05 11:03:03 +02:00
Julius Volz
fcf784c13c Fix query error notification in tabular view.
Instead of "Unsupported value type" when type="error", the delivered
error message should be shown.
2013-08-02 09:04:13 +02:00
Julius Volz
35ee2cd3cb Add alertmanager notification support to Prometheus.
Alert definitions now also have mandatory SUMMARY and DESCRIPTION fields
that get sent along a firing alert to the alert manager.
2013-07-30 17:23:41 +02:00
Julius Volz
4e941255d8 Add caching to static assets when served from blob handler. 2013-07-24 18:52:57 +02:00
Julius Volz
1b9cbaf842 Bootstrappify remaining status pages. 2013-07-24 16:09:34 +02:00
Julius Volz
481ee4096b Add no-op silencing links. 2013-07-24 15:09:42 +02:00
Julius Volz
d9f403ab7d Prettify/Bootstrapify alert tables. 2013-07-24 15:03:13 +02:00
Julius Volz
f665534b61 Make quote and semicolon usage consistent in graph.js 2013-07-24 12:29:03 +02:00
Julius Volz
c91c100102 Fix graph resize bug when no graph exists. 2013-07-24 12:29:03 +02:00
Julius Volz
9f07f8677a Generate tabular console view from JSON data. 2013-07-24 12:28:59 +02:00
Sabra Melamed
22ab2366c1 Replacing interface components with Bootstrap.
This commit includes Bootstrap 2.3.2 and swaps a multitude of graph,
status, and other components to Bootstrap-based widgets.
2013-07-23 20:58:55 +02:00
Matt T. Proud
f7704af4f8 Code Review: Formatting comments. 2013-07-15 15:12:01 +02:00
Matt T. Proud
06b4a40661 Represent targets in a tabular interface.
This commit represents a target group's endpoints in a tabular fashion for better differentiation
of their state in a concise manner.
2013-07-15 15:12:01 +02:00
Julius Volz
f42adc1cc0 Display Y-axis outside of graph. 2013-07-01 14:47:43 +02:00
Julius Volz
1aa8f071b9 Add content compression support to API HTTP responses. 2013-06-28 16:56:44 +02:00
Matt T. Proud
30b1cf80b5 WIP - Snapshot of Moving to Client Model. 2013-06-25 15:52:42 +02:00
Julius Volz
0226d1ac7a Implement alerts dashboard and expression console links. 2013-06-13 22:35:40 +02:00
Johannes 'fish' Ziemke
005d65868a Merge pull request #294 from prometheus/remove-gvm
Remove gvm
2013-06-13 05:41:29 -07:00
Johannes 'fish' Ziemke
56249320e3 Remove gvm on travis. 2013-06-13 14:36:00 +02:00
Julius Volz
1fe3d3b06b Remove obsolete argument from target handling code. 2013-06-11 17:54:58 +02:00
Julius Volz
ba29d07901 Show loaded rules in Status dashboard. 2013-06-11 11:39:31 +02:00
Matt T. Proud
a73f061d3c Persist solely Protocol Buffers.
An design question was open for me in the beginning was whether to
serialize other types to disk, but Protocol Buffers quickly won out,
which allows us to drop support for other types.  This is a good
start to cleaning up a lot of cruft in the storage stack and
can let us eventually decouple the various moving parts into
separate subsystems for easier reasoning.

This commit is not strictly required, but it is a start to making
the rest a lot more enjoyable to interact with.
2013-06-08 11:02:35 +02:00
Bernerd Schaefer
f7a2436665 Include link to user dashboard when provided 2013-06-07 11:17:17 +02:00
Bernerd Schaefer
1d794896ac Support user-provided static asset directory
[fix #159]
2013-06-07 10:25:12 +02:00
Julius Volz
51689d965d Add debug timers to instant and range queries.
This adds timers around several query-relevant code blocks. For now, the
query timer stats are only logged for queries initiated through the UI.
In other cases (rule evaluations), the stats are simply thrown away.

My hope is that this helps us understand where queries spend time,
especially in cases where they sometimes hang for unusual amounts of
time.
2013-06-05 18:32:54 +02:00
Matt T. Proud
0d2d6e9a27 Include uptime in the status console.
In order to help corroborate whether a Prometheus instance has
flapped until meta-monitoring is in-place, we ought to provide the
instance's start time in the console to aid in diagnostics.
2013-05-24 10:44:34 +02:00
Julius Volz
8586c7520c Support negative graph values.
Currently graph Y-Axes were hardcoded to start at 0. Choose the Y-scale
automatically based on the graph data instead.
2013-05-21 16:54:33 +02:00
Julius Volz
081191afb8 Remember and display last scrape errors in web UI. 2013-05-21 15:31:27 +02:00
Matt T. Proud
1a95406b81 Include forgotten databases.html. 2013-05-14 14:50:54 +02:00
Matt T. Proud
b224251981 Simplify compaction and expose database sizes.
This commit simplifies the way that compactions across a database's
keyspace occur due to reading the LevelDB internals. Secondarily it
introduces the database size estimation mechanisms.

Include database health and help interfaces.

Add database statistics; remove status goroutines.

This commit kills the use of Go routines to expose status throughout
the web components of Prometheus. It also dumps raw LevelDB status
on a separate /databases endpoint.
2013-05-14 12:29:53 +02:00
Bernerd Schaefer
cdde766f39 Embed mutex on web status handler 2013-05-07 18:15:17 +02:00
Bernerd Schaefer
7740167654 Add comments about potential race conditions 2013-05-07 18:15:17 +02:00
Bernerd Schaefer
9183302b1f Web handler returns 404 for favicon requests 2013-05-07 18:15:17 +02:00
Matt Proud
7f0d816574 Schedule the background compactors to run.
This commit introduces three background compactors, which compact
sparse samples together.

1. Older than five minutes is grouped together into chunks of 50 every 30
   minutes.

2. Older than 60 minutes is grouped together into chunks of 250 every 50
   minutes.

3. Older than one day is grouped together into chunks of 5000 every 70
   minutes.
2013-05-07 17:14:04 +02:00
Julius Volz
af7920126c Fix build errors and add default build step to "make". 2013-05-07 15:54:41 +02:00
Julius Volz
56324d8ce2 Make AST query storage non-global. 2013-05-07 13:15:10 +02:00
Matt T. Proud
3b9b1c6ab4 Define dependencies for web. stack concretely.
This commit destroys the use of AppState, which makes passing
concrete state along to various serving components onerous.
2013-05-06 11:13:12 +02:00
juliusv
cfc3b1053d Merge pull request #212 from prometheus/ui/smaller-navigation-links
Restyle navigation a bit, align content elements with it
2013-05-03 07:00:09 -07:00
juliusv
2935476818 Merge pull request #211 from prometheus/feature/reorder-hud-elements
Move build info to the top of the status HUD.
2013-05-03 06:56:45 -07:00
Julius Volz
04e661c28f Move build info to the top of the status HUD. 2013-05-03 15:54:32 +02:00
Julius Volz
f3cf8eae7e Restyle navigation a bit, align content elements with it. 2013-05-03 15:49:08 +02:00
Johannes 'fish' Ziemke
c5e507cd9c Never submit empty queries. 2013-05-02 16:55:47 +02:00
juliusv
2b9ba56d61 Merge pull request #208 from prometheus/feature/toggle-console
Add the console to the main/graph ui.
2013-05-02 04:05:53 -07:00
Johannes 'fish' Ziemke
ba289ef7cd Add the console to the main/graph ui. 2013-05-02 12:19:34 +02:00
Julius Volz
9cea5d9df8 Convert the Prometheus configuration to protocol buffers. 2013-04-30 22:26:00 +02:00
Matt T. Proud
3362bf36e2 Include curator status in web heads-up-display. 2013-04-29 12:40:33 +02:00
Matt T. Proud
a48ab34dd0 Refresh Prometheus client API usage.
The client API has been updated per https://github.com/prometheus/client_golang/pull/9.
2013-04-28 19:40:30 +02:00
juliusv
169a7dc26c Merge pull request #189 from prometheus/feature/build-info-and-startup-friendliness
Build info and startup friendliness
2013-04-26 05:45:34 -07:00
Bernerd Schaefer
19fc094362 Merge pull request #191 from prometheus/update-gitignore-files
Ignore web/static/generated and build/root/share
2013-04-25 03:59:04 -07:00
Bernerd Schaefer
169ed9d297 Ignore web/static/generated and build/root/share 2013-04-25 12:33:27 +02:00
Matt T. Proud
961ff26874 Fix positional flags for `cp` on Darwin.
Unfortunately ``cp`` on Darwin regards some flags as positional and
requires them to be in a specific place.  The new Protocol Buffer
descriptor bundling fails on Mac OS.
2013-04-25 12:16:51 +02:00
Bernerd Schaefer
45243ac2da Print flags on status page. 2013-04-25 12:12:05 +02:00
Bernerd Schaefer
862054e88b web.StartServing prints listening address 2013-04-25 11:59:39 +02:00
Bernerd Schaefer
a2a4f94aae StatusHandler renders build info 2013-04-25 11:57:08 +02:00
Johannes 'fish' Ziemke
1f96d4c822 Move protobuf descriptor and add content-type.
- move to static/generated
- set content-type based on extension '.description'
2013-04-24 18:51:07 +02:00
Matt T. Proud
9e02c2393a Include generated Protocol Buffer descriptor.
The Protocol Buffer compiler supports generating a machine-readable
descriptor file encoded as a provided Protocol Buffer message type,
which can be used to decode messages that have been encoded with it
after-the-fact.  The generated descriptor also bundles in dependent
message types.

We can use this to perform forensics on old Prometheus clients, if
necessary.
2013-04-24 16:59:40 +02:00
Matt T. Proud
e86f4d9dfd Convert time readers to represent time in UTC.
Go's time.Time represents time as UTC in its fundamental data type.
That said, when using ``time.Unix(...)``, it sets the zone for the
time representation to the local.  Unfortunately with diagnosis and
our tests, it is a PITA to jump between various zones, even though
the serialized version remains the same.

To keep things easy, all places where times are generated or read
are converted into UTC.  These conversions are cheap, for
``Time.In`` merely changes a pointer reference in the struct,
nothing more.  This enables me to diagnose test failures with fixture
data very easily.
2013-04-24 12:19:41 +02:00
Johannes 'fish' Ziemke
955708e8db Merge pull request #158 from prometheus/feature/auto-refresh
Add per graph auto-refresh option to web UI.
2013-04-22 05:10:17 -07:00
Julius Volz
a2623efcdf Register pprof /debug endpoints with custom HTTP mux. 2013-04-22 13:21:24 +02:00
Johannes 'fish' Ziemke
712bf5e2f9 Add per graph auto-refresh option to web UI.
This adds a drop-down menu to select/disable a auto-refresh interval.
2013-04-22 11:42:23 +02:00
Julius Volz
a0d311c9e6 Constantize job name label. 2013-04-15 11:47:54 +02:00
juliusv
f21b5ad12b Merge pull request #133 from bernerdschaefer/graph-display-tweaks
Graph display tweaks
2013-04-15 02:32:45 -07:00
Bernerd Schaefer
72bd585485 Revert style change to legend items 2013-04-15 10:04:09 +02:00
juliusv
f817106d6a Merge pull request #134 from prometheus/fix/set-job-label-from-targets-api
Set job label for targets registered through the API
2013-04-12 07:28:27 -07:00
juliusv
f89d4c2cac Merge pull request #128 from prometheus/feature/convert-host-relative-links
Convert addresses pointing to localhost in status.
2013-04-12 07:27:30 -07:00
Johannes 'fish' Ziemke
14407a076a Convert addresses pointing to localhost in status.
Until now, targets pointing to localhost in the status view are linked to localhost, so you can't follow those links by clicking on them.
This change converts the links to point to the hostname of the prometheus server.

Before:
<a href="http://localhost:9090/metrics.json">http://localhost:9090/metrics.json</a>

After:
<a href="http://hostname-of-prometheus-server:9090/metrics.json">http://localhost:9090/metrics.json</a>
2013-04-12 15:14:04 +02:00
Bernerd Schaefer
8af0bbb3a0 Set job label for targets registered through the API
This is set when jobs are statically registered (see
retrieval/targetmanager.go#L92), and should be set here, too.
2013-04-12 14:50:44 +02:00
Bernerd Schaefer
442a6d2b11 Use $ instead of jQuery 2013-04-12 13:43:53 +02:00
Bernerd Schaefer
953334a4f7 Reformat and add semicolons to graph.js 2013-04-12 13:41:53 +02:00
Bernerd Schaefer
43dc377bee Flip x_label when it would render off-page 2013-04-12 11:59:49 +02:00
Bernerd Schaefer
461e02d2b8 Flip hover detail to prevent going off the screen 2013-04-12 10:39:37 +02:00
Bernerd Schaefer
8c9597cb39 Render legend in a similar style to labels 2013-04-12 10:39:15 +02:00
Bernerd Schaefer
a7ec43189a Hovering over legend items highlights series in graph 2013-04-12 09:34:12 +02:00
Bernerd Schaefer
564633ecbc Render graph labels vertically
This helps to make the timeseries with many labels fit on the screen.
2013-04-12 09:34:12 +02:00
Bernerd Schaefer
5e9447996b Set CORS Headers on API requests
By setting Access-Control headers, the Prometheus metrics API can be
accessed by cross-origin javascript applications (e.g., an external
dashboard pulling Prometheus metrics).
2013-04-11 14:51:42 +02:00
Johannes 'fish' Ziemke
8fba639706 Fix path to expression browser js. 2013-04-10 13:09:32 +02:00
Johannes 'fish' Ziemke
adeabca230 Minor UI fixes.
- Fix path to spinner
- Fix color for unvisited links
- Include necessary jqueryui images
2013-04-09 15:23:37 +02:00
Johannes 'fish' Ziemke
e43d7d5771 Make Prometheus self-contained.
This includes all external resources instead of hotlinking them.
2013-04-09 12:15:05 +02:00
Johannes 'fish' Ziemke
17f622bd6e Take Path fragment from URL instead of whole URL.
This also makes better error handling in case a asset couldn't be found in the files map.
2013-04-09 12:12:24 +02:00
Johannes 'fish' Ziemke
bf197baaf9 Depend on all static and template files. 2013-04-09 12:11:19 +02:00
Johannes 'fish' Ziemke
c108a9978d Merge branch 'master' of github.com:prometheus/prometheus into feature/navigation
Conflicts:
	web/web.go
2013-04-05 14:16:33 +02:00
Johannes 'fish' Ziemke
0f775a4178 Use Sprintf instead of string concatenation. 2013-04-05 13:41:52 +02:00
Johannes 'fish' Ziemke
1c091a9723 Use client_golang.exp for automatic telemetry. 2013-04-05 13:24:50 +02:00
Johannes 'fish' Ziemke
3aead8468c Fix typo. 2013-04-04 19:19:58 +02:00
Johannes 'fish' Ziemke
84d17b4d97 Replace YieldExporter() with Handler() 2013-04-04 19:08:20 +02:00
Johannes 'fish' Ziemke
1cb4c819e1 Remove cruft. 2013-04-04 19:02:29 +02:00
Johannes 'fish' Ziemke
1a3fb459e0 Add navigation menu to all pages + change routes.
To achieve that, this PR
- converts static/index.html ("console") and graph to templates
- moved the handlebars template to separated file to avoid escaping issues

Route changes:
/status -> /
/static -> /console
/static/graph.html -> /graph
2013-04-04 16:36:53 +02:00
Matt T. Proud
7764682c7c Update to use new default handler. 2013-04-02 15:20:30 +02:00
Julius Volz
ec413459fa Depointerize Matrix/Vector types as well as time.Time arguments. 2013-03-28 18:07:12 +01:00
Johannes 'fish' Ziemke
fed467ede0 Moved graph and console to use templates as well. 2013-03-27 18:44:47 +01:00
Johannes 'fish' Ziemke
f27adac848 Split status template into two templates.
This is now using a base template (_base.html) for the 'layout' of the web UI.
Within that base template, the actual content templates get rendered.
2013-03-27 17:40:01 +01:00
Julius Volz
2b8f0b2cc7 Constantize metric name label name. 2013-03-26 16:20:23 +01:00
Julius Volz
dd67ab115b Change GetAllMetricNames() to GetAllValuesForLabel(). 2013-03-26 14:47:07 +01:00
Johannes 'fish' Ziemke
b0d1864146 Move css for graphs to graph.css and fix minor/fomatting issues. 2013-03-26 14:36:57 +01:00
Johannes 'fish' Ziemke
0a87618733 Add autocompletion for metrics. 2013-03-26 14:16:23 +01:00
Johannes 'fish' Ziemke
ecb8331df1 Update jQuery to 1.9.1. 2013-03-26 14:16:23 +01:00
Johannes 'fish' Ziemke
07c76747f0 Clean up of graph UI's form.
- Removed unnecessary spaces and labels.
- Aligned elements for cleaner look.
2013-03-26 14:16:23 +01:00
Johannes 'fish' Ziemke
24b3a6d2cc Improve inserting of metrics in graph UI.
- Metric will inserted at cursor position.
- Selected text will get replaced.
- Press <tab> to jump to metrics and <return> to jump back.
2013-03-26 14:16:23 +01:00
Johannes 'fish' Ziemke
3626b71c22 Improve graph UI.
- resize graphs on browser resize
- move status field to upper right corner to save some space
- align the legend width to the graph's width
2013-03-26 14:16:22 +01:00
Matt T. Proud
3e97a3630d Include nascent curator scaffolding.
The curator doesn't do anything yet; rather, this is the type
definition including the anciliary testing scaffold.

Improve Makefile and Git developer experience.

The top-level Makefile was a bit overloaded in terms of generation of
assets and their management.  This has been offloaded into separate
Makefiles.

The Git developer experience sucked due to lack of .gitignore
policies.

Also: Fix faulty skiplist naming from old merge.
2013-03-25 19:38:14 +01:00
Johannes 'fish' Ziemke
b290c821d1 Renamed "localAssets" cmd flag to "useLocalAssets". 2013-03-25 12:09:39 +01:00
Johannes 'fish' Ziemke
9bb6820402 Use filename based type if DetectContentType fails.
DetectContentType returns text/plain for our stylesheets and javascripts. That causes chrome to ignore those files.
2013-03-22 12:03:31 +01:00
Julius Volz
8e4c5b0cea Use AST query analyzer and views with tiered storage. 2013-03-21 18:16:52 +01:00
Matt T. Proud
1b0ca377af Reformat. 2013-03-21 18:11:34 +01:00
Julius Volz
20c5ca1d72 Lower-case web API method arguments. 2013-03-21 18:11:02 +01:00
juliusv
91c5e29f1f Merge pull request #91 from prometheus/feature/datetimepicker
Add a date/time picker to graph UI
2013-03-21 09:56:09 -07:00
Johannes 'fish' Ziemke
6213c0f1ee Add missing semicolons. 2013-03-21 17:54:03 +01:00
Johannes 'fish' Ziemke
72bd751857 Increase/decrease end date by 1/2 range. 2013-03-21 17:47:40 +01:00
Johannes 'fish' Ziemke
c0b5ba6512 Prevent unnecessary reload. 2013-03-21 17:44:21 +01:00
Johannes 'fish' Ziemke
f170720f61 Use hidden input for end.
Instead of appending to url manually.
2013-03-21 17:36:04 +01:00
Johannes 'fish' Ziemke
8e55ff0a8d Save and restore end date in/from url. 2013-03-21 17:06:37 +01:00
Johannes 'fish' Ziemke
1f484b03c7 Renamed date_s to dateString.
To be more explicit.
2013-03-21 15:56:41 +01:00
Johannes 'fish' Ziemke
a5e18b0229 Rename localAssets to useLocalAssets. 2013-03-21 15:55:48 +01:00
Johannes 'fish' Ziemke
f9b4df4284 Add a date/time picker to graph UI.
- It's using https://github.com/mugifly/jquery-simple-datetimepicker
- If input is empty, it returns the most recent data
2013-03-21 14:26:13 +01:00
Johannes 'fish' Ziemke
bf5d312a74 Add flag to read assets from local files. 2013-03-21 13:55:59 +01:00
Matt T. Proud
05a9c3cd0b Improve the base label representation in /status.
The base label representation under /status needs improvement to
enhance readability; namely, add sorting and make the label
representation concise.
2013-03-21 12:08:18 +01:00
Johannes 'fish' Ziemke
2434bac219 Detect mime type on runtime instead of hardcoding. 2013-03-19 17:40:27 +01:00
Johannes 'fish' Ziemke
a5d31cb239 Use constants for blob bucket keys. 2013-03-19 17:40:27 +01:00
Johannes 'fish' Ziemke
fc16580b4c Ship assets in compiled binary.
- utility/embed-static.sh, get called in Makefile to create go map from files
- web/blob/blob.go implements http Handle for serving the files from the map
- web/status.go uses blog.GetFile() to get the template file

The assets are gzipped and decompressed on demand.
2013-03-19 17:40:27 +01:00
Julius Volz
f1fc7d717a Allow replacing job targets via HTTP API.
This roughly comprises the following changes:

- index target pools by job instead of scrape interval
- make targets within a pool exchangable while preserving existing
  health state for targets
- allow exchanging targets via HTTP API (PUT)
- show target lists in /status (experimental, for own debug use)
2013-02-28 21:33:29 +01:00
Julius Volz
a908e397bc Integrate cleanups for comments in PR70. 2013-02-14 19:03:17 +01:00
Julius Volz
23374788d3 Beginnings of a Prometheus status page. 2013-02-14 19:03:17 +01:00
Matt T. Proud
d1e7f5bc4b The Prometheus Go client has a new handler API. 2013-02-13 09:46:41 -08:00
Julius Volz
2859227fdb Make HTTP listen address a flag. 2013-02-08 15:42:09 +01:00
Julius Volz
0cbd03ccf9 Move web-related code/resources to a subdirectory. 2013-02-08 14:52:36 +01:00