Commit graph

5660 commits

Author SHA1 Message Date
Simon Pasquier e5dbac7972 cmd/prometheus: group flags properly (#5419)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-10 13:22:05 +01:00
Simon Pasquier dafd1632a2 discovery/kubernetes: add present labels for labels/annotations (#5443)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-10 13:21:42 +01:00
Simon Pasquier c1682adb2f Bump prometheus/common to v0.3.0 (#5344)
* Reload certificates from disk automatically

This change bumps github.com/prometheus/common to include
https://github.com/prometheus/common/pull/173

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* scrape: close idle connections on reload/stop

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* use v0.3.0 tag

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-10 13:20:00 +01:00
Lucas Servén Marín 0e42449b78 docs/querying: improve wording (#5442)
This commit improves the wording of the subquery examples and makes
them more consistent with other examples.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
2019-04-09 17:48:41 +01:00
Frederic Branczyk 141a165eb1
Merge pull request #5441 from prometheus/29docs
Put myself down for 2.9 release.
2019-04-09 17:00:11 +02:00
Brian Brazil c8ee34d0b4 Put myself down for 2.9 release.
Update docs on where to email release announcements.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2019-04-09 14:21:24 +01:00
Callum Styan c2b88992a3 Remote Write: fix checkpoint reading (#5429)
* Fix ReadCheckpoint to ensure that it actually reads all the contents of
each segment in a checkpoint dir, or returns an error.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-04-09 10:52:44 +01:00
Brian Brazil f7184978f4 Protect against memory exhaustion when scraping.
Now that we're not losing the scrape cache across failed
scrape, a scrape that continually failed but had varying
series or metadata (e.g. timestamps in metric names,
plus hitting smaple_limit) would grow the cache indefinitely.

Add some code to catch that, and flush the cache anyway.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2019-04-04 19:09:11 +01:00
Brian Brazil dd3073616c Don't lose the scrape cache on a failed scrape.
This avoids CPU usage increasing when the target comes back.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2019-04-04 19:09:11 +01:00
Simon Pasquier 4f47806a7d
discovery/dns: fix slice with wrong length (#5432)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-04 17:05:35 +02:00
Simon Pasquier 81c4248081
*: bump gRPC and protobuf dependencies (#5367)
The goal is to remove almost all references to the
golang.org/x/net/context package.

github.com/gogo/protobuf => v1.2.1
google.golang.org/grpc => v1.19.1
github.com/grpc-ecosystem/grpc-gateway => v1.18.5

It also replaces github.com/cockroachdb/cmux by github.com/soheilhy/cmux
because of [1] which fixes #3909 incidentally.

[1] https://github.com/grpc/grpc-go/issues/2636

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-04 11:55:32 +02:00
Kien Nguyen-Tuan 813b58367a [OpenStack SD] Add ProjectID and UserID meta labels (#5431)
Add extra meta labels which will be useful in the case
Prometheus discovery instances from all projects.

Signed-off-by: Kien Nguyen <kiennt2609@gmail.com>
2019-04-04 10:02:31 +01:00
Bob Shannon f8932dde66 Improve docs for query POST requests (#5428)
Signed-off-by: Bob Shannon <bobs@dropbox.com>
2019-04-02 20:44:03 +01:00
Bob Shannon 8c8bb82d04 Add support for POSTing to /series endpoint (#5422)
* Add support for POSTing to /series endpoint
* Document query API POST support

Signed-off-by: Bob Shannon <bob.m.shannon@gmail.com>
2019-04-02 18:00:29 +01:00
Björn Rabenstein e5a427f2ef
Merge pull request #5418 from tariq1890/update_promclient
import the latest patch release of client_golang in prometheus
2019-03-31 17:20:43 +02:00
Ganesh Vernekar 0afd172224
Merge pull request #5416 from prometheus/release-2.8
Merge 2.8.1 into master
2019-03-29 15:20:49 +05:30
Tariq Ibrahim 1ef6aaee24
Update CHANGELOG.md
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

Co-Authored-By: codesome <cs15btech11018@iith.ac.in>
2019-03-29 15:11:53 +05:30
tariqibrahim be394823c6 import the latest patch release of client_golang in prometheus
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-29 02:12:52 -07:00
Ganesh Vernekar 4d60eb36dc
Merge pull request #5413 from codesome/release-2.8.1
*: cut 2.8.1
2019-03-28 23:31:07 +05:30
Ganesh Vernekar 031ee49674
*: cut 2.8.1
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2019-03-28 19:06:32 +05:30
David Symonds 7a60e22c2d cmd/promtool: resolve relative paths in alert test files (#5336)
Like `promtool check config <path/to/foo.yaml>`, which resolves relative
paths inside foo.yaml to be relative to `path/to`, this now makes
`promtool test rules <path/to/test.yaml>` do the same thing.

Signed-off-by: David Symonds <dsymonds@gmail.com>
2019-03-27 10:27:26 +01:00
Ganesh Vernekar a56484ddb7
Merge pull request #5406 from simonpasquier/fix-job-label-targets
web/ui: display the job label in /targets
2019-03-26 23:06:14 +05:30
Simon Pasquier 7328cb6cc2 web/ui: display the job label in /targets
PR #4806 was removed accidentally by #5192 (Bootstrap upgrade).

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-26 16:52:48 +01:00
Tariq Ibrahim 8fdfa8abea refine error handling in prometheus (#5388)
i) Uses the more idiomatic Wrap and Wrapf methods for creating nested errors.
ii) Fixes some incorrect usages of fmt.Errorf where the error messages don't have any formatting directives.
iii) Does away with the use of fmt package for errors in favour of pkg/errors

Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-26 00:01:12 +01:00
Brian Brazil 0a87dcd416
cmd: Warn rather than Info when retention time wraps (#5403)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2019-03-25 18:06:38 +00:00
Goutham Veeramachaneni 19152a45d8
lockbot: don't comment when locking issues (#5402)
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2019-03-25 17:13:47 +05:30
Simon Pasquier 782d00059a
discovery: factorize for SD based on refresh (#5381)
* discovery: factorize for SD based on refresh

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* discovery: use common metrics for refresh

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-25 11:54:22 +01:00
Ben Kochie b95f4337a8
Add config for GitHub Lock app (#5392)
Add a configuration for https://github.com/apps/lock
* Only for issues older than 180 days.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-03-22 10:04:13 +01:00
Bharath 91306bdf24 Support non POST methods for Lifecycle and Admin APIs (#5376)
Signed-off-by: Bharath Thiruveedula <bharath_ves@hotmail.com>
2019-03-20 17:33:45 +00:00
Simon Pasquier 2833ad490b
vendor: bump github.com/hashicorp/serf (#5378)
hashicorp/serf is only required as a dependency of hashicorp/consul so
bumping the version has no direct consequence for Prometheus itself. The
net gain is that we don't depend anymore on launchpad.net/gocheck which
required the bzr binary to be installed.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-20 16:36:55 +01:00
Tariq Ibrahim 0d7104b7eb discovery/azure:optimize iteration logic for VMScalesets, VMScalesetVMs, and VMs (#5363)
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-20 09:03:47 +00:00
Matthias Loibl b7e978d255 web/ui: Fix padding in navbar container (#5371)
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2019-03-18 23:17:49 +01:00
Callum Styan 5603b857a9 Check if label value is valid when unmarhsaling external labels from
YAML, add a test to config_tests for valid/invalid external label
value.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-03-18 20:31:12 +00:00
Tom Wilkie 807fd33ecc Review feedback.
- Update read path to use labels.Labels.
- Fix the tests.
- Remove pack.
- Remove unused function.
- Fix race in tests.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2019-03-18 20:31:12 +00:00
Callum Styan 1a7923dde3 Add ref counting to string interning so we can remove
a string when there are no longer any refs. Add tests for interning.

Co-authored-by: Tom Wilkie <tom.wilkie@gmail.com>

Signed-off-by: Callum Styan <callumstyan@gmail.com>
2019-03-18 20:31:12 +00:00
Tom Wilkie cbf5f13285 Naive string iterning for labes & values in the remote_write path.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2019-03-18 20:31:12 +00:00
Tom Wilkie c7b3535997 Use pkg/relabelling in remote write.
- Unmarshall external_labels config as labels.Labels, add tests.
- Convert some more uses of model.LabelSet to labels.Labels.
- Remove old relabel pkg (fixes #3647).
- Validate external label names.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2019-03-18 20:31:12 +00:00
Julien Pivotto 6c72cdb1e1 Add GODEBUG to the runtime page (#5324)
This is useful, e.g. with go 1.12 to see if TLS1.3 has been enabled.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-18 11:10:13 +00:00
Giedrius Statkevičius 10ec2552af promparse: sort all labels when parsing (#5372)
* promparse: sort all labels when parsing

Some label names might start with an uppercase letter in which case it
needs to come before __name__. Without this it means that we are not
maintaining the same invariant that all label names should be sorted in
such cases.

Amend the tests to check this problem automatically. Without the change
the tests do not pass.

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
2019-03-16 10:10:07 +00:00
Tariq Ibrahim 5f933e99d0 discovery/azure: make local virtualMachine struct more generic by removing the go sdk field reference (#5350)
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-15 16:18:37 +00:00
James Ravn e15d8c5802 reload: copy state on both name and labels (#5368)
* reload: copy state on both name and labels

Fix https://github.com/prometheus/prometheus/issues/5193

Using just name causes the linked issue - if new rules are inserted with
the same name (but different labels), the reordering will cause stale
markers to be inserted in the next eval for all shifted rules, despite
them not being stale.

Ideally we want to avoid stale markers for time series that still exist
in the new rules, with name and labels being the unique identifer.

This change adds labels to the internal map when copying the old rule
data to the new rule data. This prevents the problem of staling rules
that simply shifted order.

If labels change, it is a new time series and the old series will stale
regardless. So it should be safe to always match on name and labels when
copying state.

Signed-off-by: James Ravn <james@r-vn.org>
2019-03-15 15:23:36 +00:00
Simon Pasquier 23069b87dc scrape: fallback to hostname if lookup fails (#5366)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-15 12:02:16 +00:00
Julien Pivotto 4397916cb2 Add honor_timestamps (#5304)
Fixes #5302

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-15 10:04:15 +00:00
Julius Volz 8155cc4992
Expose lexer item types (#5358)
* Expose lexer item types

We have generally agreed to expose AST types / values that are necessary
to make sense of the AST outside of the promql package. Currently the
`UnaryExpr`, `BinaryExpr`, and `AggregateExpr` AST nodes store the lexer
item type to indicate the operator type, but since the individual item
types aren't exposed, an external user of the package cannot determine
the operator type. So this PR exposes them.

Although not all item types are required to make sense of the AST (some
are really only used in the lexer), I decided to expose them all here to
be somewhat more consistent. Another option would be to not use lexer
item types at all in AST nodes.

The concrete motivation is my work on the PromQL->Flux transpiler, but
this ought to be useful for other cases as well.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fix item type names in tests

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-03-14 20:53:55 +01:00
Tariq Ibrahim 985eaa8194 add go 1.12.x to the travis, circleci, and promu YAMLs (#5305)
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-14 16:40:57 +00:00
Mario Trangoni 5354ffff99 Fix some spelling issues (#5361)
See,
$ codespell -S './vendor/*,./.git*,./web/ui/static/vendor*' --ignore-words-list="uint,dur,ue,iff,te,wan"

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-03-14 14:38:54 +00:00
Simon Pasquier 9f8e16248c
Makefile.common: run staticcheck for linux, freebsd and darwin only (#5331)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-14 09:47:36 +01:00
Simon Pasquier b0be270958
Makefile.common: add deps target (#5339)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-13 08:58:11 +01:00
Tariq Ibrahim d6f0e14ac6 fix redundant err!=nil check in web.go (#5346)
Signed-off-by: tariqibrahim <tariq181290@gmail.com>
2019-03-12 16:25:46 +00:00
Simon Pasquier 67385f356f
discovery/openstack: pass context to the OpenStack client (#5231)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-12 13:53:03 +01:00