Commit graph

4850 commits

Author SHA1 Message Date
Yecheng Fu 8ceb8f2ae8 Refactor Kubernetes Discovery Part 2: Refactoring
- Do initial listing and syncing to scrape manager, then register event
  handlers may lost events happening in listing and syncing (if it
  lasted a long time). We should register event handlers at the very
  begining, before processing just wait until informers synced (sync in
  informer will list all objects and call OnUpdate event handler).
- Use a queue then we don't block event callbacks and an object will be
  processed only once if added multiple times before it being processed.
- Fix bug in `serviceUpdate` in endpoints.go, we should build endpoints
  when `exists && err == nil`. Add `^TestEndpointsDiscoveryWithService`
  tests to test this feature.

Testing:

- Use `k8s.io/client-go` testing framework and fake implementations which are
  more robust and reliable for testing.
- `Test\w+DiscoveryBeforeRun` are used to test objects created before
  discoverer runs
- `Test\w+DiscoveryAdd\w+` are used to test adding objects
- `Test\w+DiscoveryDelete\w+` are used to test deleting objects
- `Test\w+DiscoveryUpdate\w+` are used to test updating objects
- `TestEndpointsDiscoveryWithService\w+` are used to test endpoints
  events triggered by services
- `cache.DeletedFinalStateUnknown` related stuffs are removed, because
  we don't care deleted objects in store, we only need its name to send
  a specical `targetgroup.Group` to scrape manager

Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
2018-04-25 19:28:34 +02:00
Yecheng Fu 9bc6ced55d Refactor Kubernetes Discovery Part 1: Add Vendor files.
Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
2018-04-25 19:28:14 +02:00
Björn Rabenstein 7cc46bafcb
Merge pull request #4113 from prometheus/beorn7/juggling
Fix the merge into release-2.2
2018-04-25 17:09:10 +02:00
Simon Pasquier 2cbba4e948 scrape: fix data races
This commit avoids passing the full scrape configuration down to the
scrape loop to fix data races when the scrape configuration is being
reloaded.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-04-18 11:17:31 +02:00
Simon Pasquier 8b89ab0173 scrape: add test detecting data races
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-04-18 11:17:25 +02:00
Björn Rabenstein f8dcf9b272
Merge pull request #4066 from krasi-georgiev/race-DiscoveredLabels
add mutex for DiscoveredLabels
2018-04-10 15:36:56 +02:00
Krasi Georgiev dc29dd1c6f add mutex for DiscoveredLabels
Signed-off-by: Krasi Georgiev <krasi.root@gmail.com>
2018-04-10 00:18:58 +03:00
Björn Rabenstein e65fc8591a
Merge pull request #4064 from prometheus/beorn7/vendoring
Update vendoring of prometheus/common/route to include data race fix
2018-04-09 17:50:06 +02:00
beorn7 bd44e7fe98 Update vendoring of prometheus/common/route to include data race fix
See https://github.com/prometheus/common/pull/125

Signed-off-by: beorn7 <beorn@soundcloud.com>
2018-04-09 17:48:32 +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
Björn Rabenstein 6cf725c56d
Merge pull request #4031 from codesome/fix-bug-from-4025
Fix bug from 4025
2018-03-30 16:41:30 +02: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
Björn Rabenstein 61accb51ac
Merge pull request #4025 from codesome/route-prefix
Fixed pathPrefix for web pages
2018-03-29 16:22:54 +02:00
Ganesh Vernekar f30b37e00b Fixed pathPrefix for web pages 2018-03-29 18:02:25 +05:30
Fabian Reinartz bc6058c812
Merge pull request #3952 from prometheus/cut221
*: cut 2.2.1
2018-03-14 10:12:35 -04:00
Fabian Reinartz f22e5dce1a *: cut 2.2.1 2018-03-14 10:02:06 -04:00
Fabian Reinartz a947750dd6 vendor: update tsdb 2018-03-14 10:01:44 -04:00
Fabian Reinartz 0847a605a7
Merge pull request #3959 from prometheus/22-pick-ring
Cherrypick #3942 onto release 2.2
2018-03-14 07:02:37 -04:00
Brian Brazil a8e3d0fc4b Correctly handle pruning wraparound after ring expansion (#3942)
Fixes #3939
2018-03-14 08:25:53 +00:00
Fabian Reinartz fcb8e9ac95
Merge pull request #3951 from prometheus/tsdbup3
vendor: update prometheus/tsdb
2018-03-13 21:47:55 +01:00
Fabian Reinartz 5fb1e27b43 vendor: update prometheus/tsdb 2018-03-13 16:24:37 -04:00
Tom Wilkie d8cfd8f108
Merge pull request #3950 from prometheus/cherrypick-3941
Cherrypick #3941 "Correctly stop the timer used in the remote write path."
2018-03-13 13:38:15 +00:00
Tom Wilkie 597c17d3e9 Fix nit. 2018-03-13 09:30:51 +00:00
Tom Wilkie 731259afd0 Test sample timeout delivery. 2018-03-13 09:30:50 +00:00
Tom Wilkie fdb574b608 Review feedback. 2018-03-13 09:30:50 +00:00
Tom Wilkie 97a5fc8cbb Correctly stop the timer used in the remote write path. 2018-03-13 09:30:50 +00:00
Fabian Reinartz f63e7db4cb
Merge pull request #3931 from prometheus/cut200
*: cut v2.2.0
2018-03-08 17:37:57 +01:00
Fabian Reinartz 6b9cbacf52 *: cut v2.2.0 2018-03-08 15:37:46 +01:00
Fabian Reinartz 60edc2b6d5
Merge pull request #3928 from prometheus/snaphead
Add option to skip head on snapshots
2018-03-08 13:25:22 +01:00
Fabian Reinartz 3e6c890aea api: add flag to skip head on snapshots 2018-03-08 13:07:12 +01:00
Fabian Reinartz 07299cec17 vendor: update tsdb 2018-03-08 10:49:35 +01:00
Marek Siarkowicz 1f71caf23f Add golang runtime information to status page. (#3914) 2018-03-07 15:14:46 +00:00
Marek Siarkowicz 86011047ca Validate required fields in sd configuration (#3911) 2018-03-05 19:27:54 +00:00
Krasi Georgiev 5bda3a8ded Check for unused vendored packages (#3892)
* add check for unused vendor packages
* cleanup unused vendor packages
* run unused check before the tests
2018-03-02 10:20:45 +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
Fabian Reinartz 7b7e3506ac
Merge pull request #3899 from krasi-georgiev/gogofast
revert to using the gogofast plugin and regenerate grpc server
2018-03-01 11:10:51 +01:00
Krasi Georgiev 99e717ad18 revert ot using the gogofast plugin and regenerate grpc server 2018-03-01 11:57:31 +02:00
Fabian Reinartz ef567ceb7d
Merge pull request #3835 from krasi-georgiev/pool-package-generalize
Pool package generalize
2018-02-28 14:30:46 +01:00
Krasi Georgiev 6b0e9ef183 Validate json parse for TargetGroup Unmarshal (#3614)
Using DisallowUnknownFields in golang 1.10 to forbid unknown fields in targetGroups
added the license header for the targetGroup test
2018-02-27 12:33:27 +00:00
Ben Kochie e392b9a18b Cleanup licence check script (#3893)
* Cleanup licence check script

* `echo -e` is not supported by POSIX shell.
* Add a license to the check script.
* Split out license check loop into function for clarity.

* Exit 1
2018-02-27 10:06:38 +00:00
Krasi Georgiev 0f00d77661 enable race detection for the tests (#3884) 2018-02-26 23:27:59 +00:00
Frederic Branczyk b9e836c7b7
Merge pull request #3102 from pgier/unset-gobin-during-build
Unset GOBIN in Makefile
2018-02-26 11:24:07 +01:00
Krasi Georgiev 4fa7e719f4 race in Triton SD Test (#3885) 2018-02-26 10:03:50 +00:00
Krasi Georgiev 7af69ad988 bump to golang 1.10 (#3856) 2018-02-26 09:42:49 +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
Jeffrey Zhang 21f96caab3 Fix wrong syntax for alert field templates (#3883) 2018-02-24 09:37:43 +00:00
Conor Broderick 99006d3baf Added dropped targets API to targets endpoint (#3870) 2018-02-21 17:26:18 +00:00
Fabian Reinartz cd5e2fe687
Merge pull request #3874 from prometheus/22rc1
*: cut 2.2.0-rc.1
2018-02-21 17:28:18 +01:00