Commit graph

727 commits

Author SHA1 Message Date
Ivan Voronchihin b3441cb0e7 Fix graph page for IE11 (#4148)
Signed-off-by: bege13mot <bege13mot@gmail.com>
2018-05-07 13:26:38 +01:00
Eric V c207920500 Added HTTP security headers to web.go (#3583)
Signed-off-by: Eric Valenzuela <evalenzuela@thousandeyes.com>
2018-05-03 07:27:34 +01:00
Karsten Weiss d79d573f71 Fix spelling mistakes found by codespell (#4065)
Signed-off-by: Karsten Weiss <knweiss@gmail.com>
2018-04-27 13:04:02 +01:00
beorn7 94ff07b81d Merge branch 'release-2.2'
Signed-off-by: beorn7 <beorn@soundcloud.com>
2018-04-10 16:50:35 +02:00
Krasi Georgiev ddd46de6f4 Races/3994 (#4005)
Fix race by properly locking access to scrape pools. Use separate mutex for information needed by UI so that UI isn't blocked when targets are being updated.
2018-04-09 15:18:25 +01:00
Mario Trangoni 464e747f1e fix some comments typos (#4059) 2018-04-08 10:51:54 +01:00
Ganesh Vernekar b44ce11d1b Added test to check pathPrefix 2018-03-30 11:55:54 +05:30
Ganesh Vernekar cd2820e165 Fix pathPrefix bug from PR-4025 2018-03-30 11:04:15 +05:30
Ganesh Vernekar f30b37e00b Fixed pathPrefix for web pages 2018-03-29 18:02:25 +05:30
Krasi Georgiev 5fec98d0a7 simplify server error handling (#4006) 2018-03-25 10:05:59 +01:00
Marek Siarkowicz bb86c3f62b Report internal runtime information on status page (#3921)
Add information about tsdb, wal and config reload
2018-03-21 16:08:37 +00:00
Brian Brazil cc39021b2b Provide custom marshalling for Point
Point has a non-standard marshalling, and is also
where the vast majority of CPU time is spent so
it is worth optimising.
2018-03-21 15:02:01 +00:00
Brian Brazil 299b78a887 Switch to json-iterator for v1 api.
This makes queries ~15% faster and cuts cpu
time spent on json encoding by ~40%.
2018-03-21 15:02:01 +00:00
Brian Brazil 8ede14b24c Add unittests for Point json output 2018-03-21 15:02:01 +00:00
Brian Brazil ecd0a9c6ba web: Add benchmark for respond() 2018-03-21 15:02:01 +00:00
Anton Tereshchenkov 4cb8f6c260 web: remove unused MetricsPath option (#3964) 2018-03-21 09:29:40 +00:00
Simon Pasquier 83325c8d82 web: replace deprecated InstrumentHandler() (#3862)
* web: replace deprecated InstrumentHandler()

This change replaces the deprecated InstrumentHandler function by the
equivalent functions from the promhttp package.

The following metrics are removed:

* http_request_duration_microseconds (Summary).
* http_request_size_bytes (Summary).
* http_requests_total (Counter).

And the following metrics are added instead:

* prometheus_http_request_duration_seconds (Histogram).
* prometheus_http_response_size_bytes (Histogram).
* promhttp_metric_handler_requests_in_flight (Gauge).
* promhttp_metric_handler_requests_total (Counter).

* Update github.com/prometheus/common/route package

* web: refactor using the new prometheus/common/route package
2018-03-21 08:16:16 +00:00
James Turnbull 4486ef013b Make show annotations checkbox match query history checkbox (#3936)
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.
2018-03-09 14:39:28 +01:00
James Turnbull 50e6aff3fd Make job heading on service discovery consistent (#3937)
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.
2018-03-09 14:33:53 +01:00
James Turnbull c3f4f2204f Refactor/redesign Unhealthy checkbox on Targets page (#3913)
* 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
2018-03-09 11:19:09 +01:00
Fabian Reinartz 3e6c890aea api: add flag to skip head on snapshots 2018-03-08 13:07:12 +01:00
Marek Siarkowicz 1f71caf23f Add golang runtime information to status page. (#3914) 2018-03-07 15:14:46 +00:00
Julien Pivotto 155faab7a2 Display annotations on Alerts page (#3900)
Fixes #1219

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2018-03-01 15:26:36 +00:00
ferhat elmas ffa673f7d8 General simplifications (#3887)
Another try as in #1516
2018-02-26 07:58:10 +00:00
Callum Jones 090e7e0959 Place Service Discovery labels inline (#3872)
Fixes #3739
2018-02-24 19:44:37 +00:00
Conor Broderick 99006d3baf Added dropped targets API to targets endpoint (#3870) 2018-02-21 17:26:18 +00:00
Conor Broderick 1fd20fc954 Add dropped alertmanagers to alertmanagers API (#3865) 2018-02-21 09:00:07 +00:00
Bartek Plotka 93a63ac5fd api: Added v1/status/flags endpoint. (#3864)
Endpoint URL: /api/v1/status/flags
Example Output:
```json
{
  "status": "success",
  "data": {
    "alertmanager.notification-queue-capacity": "10000",
    "alertmanager.timeout": "10s",
    "completion-bash": "false",
    "completion-script-bash": "false",
    "completion-script-zsh": "false",
    "config.file": "my_cool_prometheus.yaml",
    "help": "false",
    "help-long": "false",
    "help-man": "false",
    "log.level": "info",
    "query.lookback-delta": "5m",
    "query.max-concurrency": "20",
    "query.timeout": "2m",
    "storage.tsdb.max-block-duration": "36h",
    "storage.tsdb.min-block-duration": "2h",
    "storage.tsdb.no-lockfile": "false",
    "storage.tsdb.path": "data/",
    "storage.tsdb.retention": "15d",
    "version": "false",
    "web.console.libraries": "console_libraries",
    "web.console.templates": "consoles",
    "web.enable-admin-api": "false",
    "web.enable-lifecycle": "false",
    "web.external-url": "",
    "web.listen-address": "0.0.0.0:9090",
    "web.max-connections": "512",
    "web.read-timeout": "5m",
    "web.route-prefix": "/",
    "web.user-assets": ""
  }
}
```

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
2018-02-21 08:49:02 +00:00
Fabian Reinartz 309c666426
Merge pull request #3671 from prometheus/queryparams
*: implement query params
2018-02-15 12:24:34 +01:00
Lovisa Svallingson 04f723ca44 [Fix 3789]: storing/loading multiple graphs from URL (#3813)
* 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
2018-02-15 13:23:12 +07:00
James Turnbull d127a21071 Removed alert_header (#3836)
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.
2018-02-14 13:15:39 +07:00
Fabian Reinartz 7ccd4b39b8 *: implement query params
This adds a parameter to the storage selection interface which allows
query engine(s) to pass information about the operations surrounding a
data selection.
This can for example be used by remote storage backends to infer the
correct downsampling aggregates that need to be provided.
2018-02-13 12:17:22 +01:00
James Turnbull 816d755956 Added "No rules" to Web UI (#3834)
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.
2018-02-13 14:51:34 +07:00
Lovisa Svallingson 460fe4dd0c Fix: Improve typeahead on /graph page (#3742)
* 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
2018-02-02 19:16:29 +01:00
Krasi Georgiev 6ce84dbcb1 rename ScrapeManager struct to Manager to remove stutter 2018-02-01 10:06:24 +00:00
Krasi Georgiev b75428ec19 rename package retrieve to scrape
no fucnctinal changes just renaming retrieval to scrape
2018-02-01 09:55:07 +00:00
Krasi Georgiev 7858745c04 rename structs for consistency 2018-01-30 17:49:05 +00:00
Krasi Georgiev 4be9a40b89 fatalf is not thread safe so using panic instead (#3680) 2018-01-13 10:37:38 +00:00
Goutham Veeramachaneni 35a6ffbaf3
Merge pull request #3587 from krasi-georgiev/web-test-error-check
handle web_test webhandler errors.
2018-01-10 22:03:25 +05:30
Lovisa Svallingson a8ff643464 Implement browsing of previous query expressions (#3486) 2017-12-21 18:58:05 +01:00
Krasi Georgiev c94fa731aa bypass the proxy for the tests 2017-12-20 18:21:10 +00:00
Krasi Georgiev 0e58cda1fe use Fatalf instead of panic 2017-12-19 12:55:43 +00:00
Krasi Georgiev 61d793cb1f handle web_test webhandler errors. 2017-12-19 12:55:43 +00:00
Krasi Georgiev 587dec9eb9 rebased and resolved conflicts with the new Discovery GUI page
Signed-off-by: Krasi Georgiev <krasi.root@gmail.com>
2017-12-18 20:10:03 +00:00
Krasi Georgiev aca8f85699 fixed the tests 2017-12-18 17:22:50 +00:00
Krasi Georgiev e405e2f1ea refactored discovery 2017-12-18 17:22:49 +00:00
Conor Broderick b5c30090b9
Merge pull request #3544 from Conorbro/relabel
Added service discovery view showing labels before and after relabelling
2017-12-13 17:33:55 +00:00
conorbroderick 8b6f3a1bd3 Added service discovery view showing labels before and after relabelling 2017-12-13 15:46:11 +00:00
Goutham Veeramachaneni 2d73d2b892
Merge pull request #3570 from Gouthamve/colon-snapshot
Make the date returned by snapshot script friendly
2017-12-11 19:04:10 -08:00
Tom Wilkie 73fa721dd2
Merge pull request #3569 from EdSchouten/faster-federation
Deprecate DeduplicateSeriesSet() in favor of NewMergeSeriesSet().
2017-12-11 09:37:15 -06:00
pasquier-s b3eccdd828 Fix 'addrConn.resetTransport' error (#3004) (#3517)
net.Listener converts 0.0.0.0 to :: which fails for hosts where IPv6 is
disabled. This change uses the original listen address parameter instead
of grpcl.Addr().String().
2017-12-11 21:39:58 +08:00
Goutham Veeramachaneni bee6864c14 Make the date returned by snapshot script friendly
Fixes #3568

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-12-10 15:14:31 -06:00
Ed Schouten bb724f1bef Deprecate DeduplicateSeriesSet() in favor of NewMergeSeriesSet().
Federation makes use of dedupedSeriesSet to merge SeriesSets for every
query into one output stream. If many match[] arguments are provided,
many dedupedSeriesSet objects will get chained. This has the downside of
causing a potential O(n*k) running time, where n is the number of series
and k the number of match[] arguments.

In the mean time, the storage package provides a mergeSeriesSet that
accomplishes the same with an O(n*log(k)) running time by making use of
a binary heap. Let's just get rid of dedupedSeriesSet and change all
existing callers to use mergeSeriesSet.
2017-12-10 19:51:20 +01:00
Goutham Veeramachaneni e0d917e2f5
Merge pull request #3523 from Gouthamve/clean-tomb
Add endpoint to cleanup tombstones
2017-12-07 14:39:24 -06:00
Conor Broderick 08a4e0693b
Merge pull request #3556 from prometheus/remove-obsolete-todo
Remove obsolete TODO in API code
2017-12-07 15:54:47 +00:00
Shubheksha Jalan 35c1926d14 use httptest.NewRequest, remove http.ReadRequest (#3557) 2017-12-07 23:52:50 +08:00
Goutham Veeramachaneni f0599d4dbf Incorporate review-feedback
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-12-07 09:06:04 -06:00
Julius Volz ab11a457e8 Remove obsolete TODO in API code
In https://github.com/prometheus/prometheus/pull/3230/files, contexts were
added to the Querier() method instead, and Cortex is fine with that.
2017-12-07 23:01:13 +08:00
Goutham Veeramachaneni 311edc5a38 Merge branch 'master' into clean-tomb
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-12-05 10:23:21 -06:00
Goutham Veeramachaneni d8515b2580 Move Admin APIs to v1
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-12-04 00:13:43 +05:30
Brian Brazil d7b3df5ae1 Fix staticcheck errors 2017-12-02 14:52:13 +00:00
Goutham Veeramachaneni 3de10e3b44
Add CleanTombstones API endpoint
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-11-30 19:51:44 +05:30
Julien Pivotto 52c0121890 Correctly handle empty data set in the console view (#3521)
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>
2017-11-30 10:04:02 +00:00
Fabian Reinartz b3ff5f6b0e
Merge pull request #3507 from prometheus/rulepromql
Make PromQL metrics un-global, remove rules dep on promql.Engine
2017-11-28 08:55:23 +01:00
Lovisa Svallingson 2c2702e22b Align columns in Targets view (#3445)
- rebase and resolve merge conflicts
2017-11-26 12:49:24 +08:00
Fabian Reinartz 2d0e3746ac rules: remove dependency on promql.Engine 2017-11-24 07:57:54 +01:00
Fabian Reinartz 2ec5965b75
Merge pull request #3508 from prometheus/uptsdb
update TSDB
2017-11-23 19:11:54 +01:00
Fabian Reinartz 83cd270ea4 *: adapt to storage interface changes 2017-11-23 19:05:04 +01:00
Goutham Veeramachaneni a880c86375
Fix unexported method on exported interface.
Also move to model.Duration

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-11-23 19:13:57 +05:30
Conor Broderick 84eca7dfb2
Merge pull request #3491 from Conorbro/eval-rules
Add rule evaluation time
2017-11-22 16:37:16 +00:00
conorbroderick 55aaece116 Add rule evaluation time 2017-11-22 15:22:02 +00:00
David Kaltschmidt af75ce02c1 Review feedback
* renamed MakeQueryStats
* added stats to query() as well
* gofmt
2017-11-16 16:30:48 +01:00
David Kaltschmidt c93e54d240 Adds execution timer stats to the range query
API consumers should be able to get insight into the query run times.
The UI currently measures total roundtrip times. This PR allows for more
fine grained metrics to be exposed.

* adds new timer for total execution time (queue + eval)

* expose new timer, queue timer, and eval timer in stats field of the
 range query response:
```json
{
  "status": "success",
  "data": {
    "resultType": "matrix",
    "result": [],
    "stats": {
      "execQueueTimeNs": 4683,
      "execTotalTimeNs": 2086587,
      "totalEvalTimeNs": 2077851
    }
  }
}
```

* stats field is optional, only set when query parameter `stats` is not
empty

Try it via
```sh
curl 'http://localhost:9090/api/v1/query_range?query=up&start=1486480279&end=1486483879&step=14000&stats=true'
```

Review feedback

* moved query stats json generation to query_stats.go
* use seconds for all query timers
* expose all timers available
* Changed ExecTotalTime string representation from Exec queue total time to Exec total time
2017-11-16 16:05:10 +01:00
Krasi Georgiev e2f4850fea Refactor main.go with oklog/pkg/group actors pattern 2017-11-11 12:33:15 +00:00
Alexey Miroshkin 8c681f4a6c Provide POST endpoint for query+query_range (#3322)
This PR fixes #3072 by providing POST endpoints for `query` and `query_range`.
POST request must be made with `Content-Type: application/x-www-form-urlencoded` header.
2017-11-11 01:53:48 +01:00
Julius Volz 8022fc1aa3
Fix display of raw target labels (again) (#3437)
I already fixed this once in 7be94d6643,
but it seems it got broken again when merging other fixes from 1.x into
2.0.
2017-11-08 15:30:19 +01:00
Tom Wilkie 746752b946 Merge external labels in order. 2017-10-26 11:44:49 +01:00
Tom Wilkie b22485bef0 Remove spurious test import. 2017-10-26 11:09:43 +01:00
Tom Wilkie ee011d906d Port remote read server to 2.0. 2017-10-26 11:09:14 +01:00
Julius Volz 099df0c5f0 Migrate "golang.org/x/net/context" -> "context" (#3333)
In some places, where ctxhttp or gRPC are concerned, we still need to use the
old contexts.
2017-10-24 21:21:42 -07:00
Takashi Kokubun bd52950ce8 Fix invalid syntax in graph.css (#3309) 2017-10-24 10:48:58 +02:00
Fabian Reinartz 53875da7fb Merge pull request #3286 from prometheus/dev-2.0
Dev 2.0
2017-10-12 16:19:10 +02:00
BasPH a91d3bcb83 Add UI warning for time drift >30 seconds (#3276)
* Add UI warning for time drift >30 seconds

* Yellow time drift warning & better warning message

* Set warning threshold to 30 sec

* Include changed assets
2017-10-11 15:11:04 +02:00
Fabian Reinartz 269b5cf936 Merge pull request #3245 from jlevesy/use-require-web
Imports benbjohnson/testing and use it in web package
2017-10-10 10:58:27 +02:00
Brian Brazil 8740fcc657 Use panic in goroutine in test, not t.Fatalf 2017-10-09 19:44:03 +01:00
Fabian Reinartz abf7c975c9 Merge branch 'master' into dev-2.0 2017-10-07 13:37:21 +02:00
beorn7 f20e6a0ae4 Only respond to API requests once the server is ready 2017-10-06 17:20:20 +02:00
Marc Sluiter 6a633eece1 Added go-conntrack for monitoring http connections (#3241)
Added metrics for in- and outgoing traffic with go-conntrack.
2017-10-06 11:22:19 +01:00
Julien Levesy 26a067b23d use testutil assertion helpers in web package testsuite 2017-10-05 22:40:10 +02:00
Fabian Reinartz 7a3261aa99 Merge pull request #3240 from Gouthamve/fix-admin-api
web/api: Fix typo which broke the 2.0 admin APIs.
2017-10-05 14:33:12 +02:00
Fabian Reinartz 2d0b8e8b94 Merge branch 'master' into dev-2.0 2017-10-05 13:09:18 +02:00
Goutham Veeramachaneni 35aaa2002d
web/api: Add tests for v2 admin API
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-10-05 15:25:09 +05:30
Julius Volz f7e8348a88 Re-add contexts to storage.Storage.Querier() (#3230)
* Re-add contexts to storage.Storage.Querier()

These are needed when replacing the storage by a multi-tenant
implementation where the tenant is stored in the context.

The 1.x query interfaces already had contexts, but they got lost in 2.x.

* Convert promql.Engine to use native contexts
2017-10-04 21:04:15 +02:00
Goutham Veeramachaneni d70f850a18
web/api: Fix typo which broke the 2.0 admin APIs.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-10-04 17:02:32 +05:30
Tom Wilkie 639d5c6f98 Merge pull request #3023 from tomwilkie/2945-remote-read-server
Implement remote read server in Prometheus.
2017-09-28 17:19:37 +01:00
beorn7 16c95ae8e7 Merge branch 'release-1.7' 2017-09-21 18:27:12 +02:00
Fabian Reinartz 7b02bfee0a web: start web handler while TSDB is starting up 2017-09-20 15:03:19 +02:00
beorn7 dd381356a5 Tweak floating point number rendering 2017-09-19 18:53:00 +02:00
beorn7 61b6311504 Merge branch 'fix_ui_graph_decimal_axis' of git://github.com/yamatoya/prometheus into yamatoya-fix_ui_graph_decimal_axis 2017-09-19 18:30:18 +02:00
Takahito Yamatoya b1151bdabc ui changed, limit the number of digits for the larger units is 5 2017-09-19 11:11:39 +09:00