Commit Graph

27 Commits

Author SHA1 Message Date
Anders Daljord Morken e9885ecb94 Bugfix: Avoid divide-by-zero panic on query_range?step=0 2016-08-16 15:20:34 +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
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
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 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 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
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 bf84faa010 Return HTTP server error codes for execution errors 2015-11-11 16:22:20 -08: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 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
Fabian Reinartz 398bbf906b Switch to common/route package 2015-09-24 17:08:47 +02:00
Fabian Reinartz 171f50706a Fix unkeyed field errors. 2015-09-18 17:00:08 +02:00
Fabian Reinartz f8a25f6af7 Apply HTTP handler compression everywhere 2015-09-17 14:49:50 +02:00
Fabian Reinartz d6b8da8d43 Switch promql types to common/model 2015-08-25 13:49:14 +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 306e8468a0 Switch from client_golang/model to common/model 2015-08-21 13:33:38 +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
Julius Volz bc1c789bab Disallow cross-origin DELETE and POST requests. 2015-06-24 17:26:49 +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 7bb7e565a4 web/api: add GET and DELETE /series endpoints 2015-06-11 12:24:57 +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 ab9c98acac web/api: add initial API v1 implementation. 2015-06-06 21:47:36 +02:00