Commit graph

4431 commits

Author SHA1 Message Date
Jason Anderson 808f79f00a Feature: Allow getting credentials via EC2 role (#3343)
* Allow getting credentials via EC2 role

This is subtly different than the existing `role_arn` solution, which
allows Prometheus to assume an IAM role given some set of credentials
already in-scope. With EC2 roles, one specifies the role at instance
launch time (via an instance profile.) The instance then exposes
temporary credentials via its metadata. The AWS Go SDK exposes a
credential provider that polls the [instance metadata endpoint][1]
already, so we can simply use that and it will take care of renewing the
credentials when they expire.

Without this, if this is being used inside EC2, it is difficult to
cleanly allow the use of STS credentials. One has to set up a proxy role
that can assume the role you really want, and launch the EC2 instance
with the proxy role. This isn't very clean, and also doesn't seem to be
[supported very well][2].

[1]:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
[2]: https://github.com/aws/aws-cli/issues/1390

* Automatically try to detect EC2 role credentials

The `Available()` function exposed on ec2metadata returns a simple
true/false if the ec2 metadata is available. This is the best way to
know if we're actually running in EC2 (which is the only valid use-case
for this credential provider.)

This allows this to "just work" if you are using EC2 instance roles.
2017-10-25 14:15:39 +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
Julius Volz c3d6abc8e6 Fix some lint errors (#3334)
I left the promql ones and some others untouched as I remember that @fabxc
prefers them that way.
2017-10-23 14:57:30 +01:00
Julius Volz 2846d62573 Fix staticcheck issue in test (#3331)
staticcheck fails with:
storage/remote/read_test.go:199:27: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012)
2017-10-23 11:51:48 +01:00
Julius Volz 9d43176ab3 Remove unused printVersion variable (#3335)
Kingpin now automatically does this via --version.
2017-10-23 08:50:13 +01:00
Julius Volz 82c5b98496 Capitalize Prometheus in startup message (#3332)
Hey, branding :)
2017-10-23 08:49:28 +01:00
Brian Brazil 4a50f547c8 removeLabels needs a pointer to work. (#3326) 2017-10-21 08:29:03 +01:00
Callum Styan 45f9f3c539 use a timeout in the HTTP client used for consul sd (#3303) 2017-10-20 16:56:30 +01:00
Krasi Georgiev 55a1311f6a fix golint nits (#3291) 2017-10-20 14:59:53 +01:00
Björn Rabenstein be5422a166 Update command line flags in issue template (#3317) 2017-10-19 13:59:00 +01:00
Alexander Kazarin 2c163f32a5 fix for issue 2976 (#3313)
fix for null pointer exception in ZookeeperLogger
2017-10-18 17:02:20 +01:00
Thibault Chataigner bf4a279a91 Remote storage reads based on oldest timestamp in primary storage (#3129)
Currently all read queries are simply pushed to remote read clients.
This is fine, except for remote storage for wich it unefficient and
make query slower even if remote read is unnecessary.
So we need instead to compare the oldest timestamp in primary/local
storage with the query range lower boundary. If the oldest timestamp
is older than the mint parameter, then there is no need for remote read.
This is an optionnal behavior per remote read client.

Signed-off-by: Thibault Chataigner <t.chataigner@criteo.com>
2017-10-18 12:08:14 +01:00
Goutham Veeramachaneni 5ab8834bef Merge pull request #3306 from Gouthamve/rc.1
*: release v2.0.0-rc.1
2017-10-17 14:24:42 +02:00
Goutham Veeramachaneni 469629ef08 *: release v2.0.0-rc.1
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-10-17 13:51:07 +02:00
Krasi Georgiev 3697075b8f validates that the recording name to include only allowed characters. (#3305) 2017-10-17 10:22:59 +01:00
Julius Volz 9ef8518b37 Remove "package remote" garbage from license headers (#3304) 2017-10-17 02:26:38 +01:00
Julius Volz 5f715f5733 Fix typo in flag description (#3302) 2017-10-16 23:00:05 +01:00
Fabian Reinartz b5851a49e5 Merge pull request #3297 from prometheus/grobie/update-tsdb
Update prometheus/tsdb dependency
2017-10-16 21:43:55 +02:00
pasquier-s 88e4815bb7 Get OpenStack variables from env as fallback (#3293)
This change enables the OpenStack service discovery to read the
authentication parameters from the OS_* environment variables when the
identity endpoint URL is not defined in the Prometheus configuration
file.
2017-10-16 18:01:50 +01:00
Tobias Schmidt 721050c6cb Update prometheus/tsdb dependency 2017-10-16 15:36:25 +02:00
Fabian Reinartz e948721a0b Merge pull request #3274 from prometheus/matcher-anchoring
Don't add anchoring to exported `Value` matcher field
2017-10-13 07:45:55 +02:00
Bjørn Erik Pedersen b276ef1c91 Fix "go get" in README (#3288)
You start by saying that you need >= Go 1.8, then you say you need the Go 1.5 flag `GO15VENDOREXPERIMENT`, which was made default in Go 1.6.
2017-10-12 23:15:29 +01:00
Tobias Schmidt 3589f2f1d4 Merge pull request #3285 from jlevesy/use-testutils-in-cmd-subpackage
Use testutil assertion helpers in cmd package
2017-10-13 00:12:39 +02:00
Tobias Schmidt 7515a6de03 Merge pull request #3269 from alcortesm/issue-3242-config
Fix issue 3242 for package config
2017-10-13 00:11:07 +02:00
Alberto Cortés 6c67296423 config: fix error message for unexpected result of yaml marshal 2017-10-12 19:50:07 +02:00
Alberto Cortés 0f3d8ea075 config: use testutil package 2017-10-12 19:50:07 +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
Julien Levesy d7b4fa8d78 use testutil assertions in the cmd/prometheus package 2017-10-12 13:45:38 +02:00
Julien Levesy 8c1b9e45cf add a NotOk helper method in the testing package 2017-10-12 13:14:58 +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
Julius Volz 5da0fd91db Add label matcher tests 2017-10-10 17:13:55 -07:00
Julius Volz 33c1171b9c Don't add anchoring to exported Value matcher field
Instead, just make the anchoring part of the internal regex. This helps because
some users will want to read back the `Value` field and expect it to be the
same as the input value (e.g. some tests in Cortex), or use the value in
another context which is already expected to add its own anchoring, leading to
superfluous double anchoring (such as when we translate matchers into remote
read request matchers).
2017-10-10 10:10:21 -07: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
Fabian Reinartz ea879df6aa Merge pull request #3265 from mathieui/better-cmdline-errors
Provide better errors messages in commandline
2017-10-10 10:53:30 +02:00
Brian Brazil 73dc96e7f5 Fix leak of ticker in remote storage queue manager. 2017-10-09 19:44:03 +01:00
Brian Brazil 5ee07b3b3a Update staticcheck ignores
Remove things that now longer apply, ignore new things
that are acceptable.
2017-10-09 19:44:03 +01:00
Brian Brazil cc5499fcad Only close after checking for err. 2017-10-09 19:44:03 +01:00
Brian Brazil 7158675aa8 Add back continue.
Accidentally removed in
15a931dbdb
2017-10-09 19:44:03 +01:00
Brian Brazil 1545842704 TrimPrefix removes a prefix, TrimLeft removes chars 2017-10-09 19:44:03 +01:00
Brian Brazil ee88f0d222 Ensure all values are used or _ 2017-10-09 19:44:03 +01:00
Brian Brazil 8740fcc657 Use panic in goroutine in test, not t.Fatalf 2017-10-09 19:44:03 +01:00
Mathieu Pasquet 38afa507bb Provide better errors messages in commandline
Instead or only printing the help message, which is not always helpful.
For example, when upgrading from prometheus v1, the retention time value
format has changed and now only accepts one unit (e.g. "15d") where it
previously allowed more complex strings (e.g. "360h0m0s").

This commit provides the error message as an explanation for the parsing
failure.
2017-10-09 16:25:50 +02:00
Brian Brazil 37ec2d5283 Fix off by one error in concreteSeriesSet (#3262) 2017-10-09 13:37:58 +01:00
Fabian Reinartz abf7c975c9 Merge branch 'master' into dev-2.0 2017-10-07 13:37:21 +02:00
Björn Rabenstein 3569eef8b1 Merge pull request #3260 from prometheus/beorn7/release
Cut v1.8.0
2017-10-07 00:08:01 +02:00
beorn7 5829e4880d Cut v1.8.0 2017-10-06 22:13:36 +02:00
Björn Rabenstein 6bfc8f094c Merge pull request #3259 from prometheus/beorn7/web
Only respond to API requests once the server is ready
2017-10-06 18:41:11 +02:00
beorn7 f20e6a0ae4 Only respond to API requests once the server is ready 2017-10-06 17:20:20 +02:00
Björn Rabenstein 5fad671af9 Merge pull request #3257 from prometheus/beorn7/storage2
Avoid blocking in the logThrottling loop
2017-10-06 14:55:16 +02:00