Julien Pivotto
e76c436e9c
Goleak in discoveries, scrape, rules ( #7662 )
...
* Add go leak tests for discoveries with goroutines
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Add go leak tests in rules
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Add go leak tests in scrape tests
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
e07415227a
discovery: check for nil triton_sd_config ( #7671 )
...
* discovery: check for nil triton_sd_config
Note: this was discovered thanks to the added test.
The test is pretty low-level but also effective.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
93e9c010f3
Add more Go leak tests ( #7652 )
...
* Implement go leak test for promql
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Implement go leak test for Consul SD
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Implement go leak test in discovery manager
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
52cdcc2a3b
Add a check-list for new SD's ( #7634 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
a197508d09
Add docker swarm test
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
johncming
6da680c7e4
discovery/config: add swarmsd config validation.
...
Signed-off-by: johncming <johncming@yahoo.com>
4 years ago
Julien Pivotto
49f48d8f65
Fix comment
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
968c86d642
Fix comment
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
45644c82f6
Docker swarm: enable unix socket
...
Fixes #7603
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
93ecf0e14c
Refactor dockerswarm refresh for testing ( #7541 )
...
We were missing testing on the behaviour of the configuration
unmarshalling.
This PR adds a refresh command that can be used to test that we
use the correct refresh function.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
27867412a7
openstack tests: use new test.Cleanup function ( #7514 )
...
Since we dependend on go1.14 now, we can use T.Cleanup
https://golang.org/pkg/testing/#T.Cleanup
This provides a nicer approach to shut down the test server.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
John Bampton
98a69b77d1
Fix spelling ( #7512 )
...
Signed-off-by: John Bampton <jbampton@users.noreply.github.com>
4 years ago
Julien Pivotto
e1f9816a33
Openstack: Reduce timeouts ( #7507 )
...
Set saner values for openstack timeouts
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Steffen Neubauer
9c9b872087
OpenStack SD: Add availability config option, to choose endpoint type ( #7494 )
...
* OpenStack SD: Add availability config option, to choose endpoint type
In some environments Prometheus must query OpenStack via an alternative
endpoint type (gophercloud calls this `availability`.
This commit implements this option.
Co-Authored-By: Dennis Kuhn <d.kuhn@syseleven.de>
Signed-off-by: Steffen Neubauer <s.neubauer@syseleven.de>
4 years ago
Julien Pivotto
aa452d8ab4
digitalocean: use a safer pagination method ( #7498 )
...
this method is documented here: https://github.com/digitalocean/godo
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Hu Shuai
a94b570dc6
Add a unit test for newAzureResourceFromID in discovery/azure/azure.go. ( #7484 )
...
This PR is about adding a unit test for newAzureResourceFromID in discovery/azure/azure.go.
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
4 years ago
Julien Pivotto
59de58d380
Docker Swarm service discovery ( #7420 )
...
* Docker Swarm service discovery
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Pierre Souchay
1508678001
Use 10m timeouts for watches ( #7423 )
...
use ?wait=10m will give results as fast as usual when data is changing
but will perform far less requests when services do not change.
On large infrastructure, this will reduce quite a lot the number of
qps on Consul servers while having the same performance for freshness
of results.
Signed-off-by: Pierre Souchay <p.souchay@criteo.com>
4 years ago
Julien Pivotto
fb9a1a872e
DigitalOcean: limit refresh timeout ( #7425 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
c61141ce51
Add DigitalOcean service discovery ( #7407 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Martin Lee
b5d61fb66c
Add AMI to labels scraped during service discovery. ( #7386 )
...
Signed-off-by: Martin Lee <martin@martinlee.org>
5 years ago
Frederic Branczyk
7b1c0d6b66
discovery/kubernetes: Fix incorrect premature break of reading results
...
Previously `max` results stopped reading from results in tests
prematurely, as it stopped when `max` number of items were received from
the channel instead of `max` number of unique target groups received.
This caused flaky tests where the same target group was received
multiple times, as Kubernetes informers may emit the same event multiple
times.
Before this patch, running this test repeatedly failed eventually. After
this patch I have run the test many thousand times without failure.
```bash
go test -run TestEndpointsDiscoveryNamespaces -count 1000 -test.v
```
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
5 years ago
Tariq Ibrahim
06a6621b6c
update kubernetes to v1.18.x and update ingress apiVersion
...
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
5 years ago
Jop Zinkweg
1f69c38ba4
Add discovery support for triton compute nodes ( #7250 )
...
Added optional configuration item role, defaults to 'container' (backwards-compatible).
Setting role to 'cn' will discover compute nodes instead.
Human-friendly compute node hostname discovery depends on cmon 1.7.0:
c1a2aeca36
Adjust testcases to use discovery config per case as two different types are now supported.
Updated documentation:
* new role setting
* clarify what the name 'container' covers as triton uses different names in different locations
Signed-off-by: jzinkweg <jzinkweg@gmail.com>
5 years ago
Guangming Wang
5b4006ac86
cleanup: remove unnacessary nil check before range ( #7194 )
...
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
5 years ago
Bartlomiej Plotka
ee72599e5d
Reverted k8s-client-go
...
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
Bartlomiej Plotka
86ff4a1717
Updated all deps.
...
Pinned github.com/googleapis/gnostic as they introduced braking change.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
5 years ago
ZouYu
2b7437d60e
Fix some warnings: 'redundant type from array, slice, or map composite literal' ( #7109 )
...
Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
5 years ago
Marek Slabicki
8224ddec23
Capitalizing first letter of all log lines ( #7043 )
...
Signed-off-by: Marek Slabicki <thaniri@gmail.com>
5 years ago
ZouYu
f494426f73
fix warning redundant type from array, slice, or map composite literal ( #7106 )
...
Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
5 years ago
Tariq Ibrahim
0730d6eb74
remove deprecated methods from the MetricProvider interface
...
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
5 years ago
Deepjyoti Mondal
c38ca2ca95
Fix #6999 : Add architecture meta label for EC2 ( #7000 )
...
This PR adds architecture meta labels for EC2 instances
Signed-off-by: Deepjyoti Mondal <djmdeveloper060796@gmail.com>
5 years ago
coding3min
4dfbf328f2
[OpenStack SD] Add HypervisorID meta labels about id ( #6962 )
...
Add extra meta labels which will be useful in the case
Prometheus discovery hypervisor .
Signed-off-by: pzqu <pzqu@qq.com>
Co-authored-by: pzqu <pzqu@example.com>
5 years ago
Alex Gaganov
df92a00838
Expose EC2 instance lifecycle as label ( #6914 )
...
Signed-off-by: Alex Gaganov <alex.gaganov@fiverr.com>
5 years ago
Julien Pivotto
c67f81937c
discovery: updateGroup should not create targets[poolKey] in the loop ( #6903 )
...
We can assume that not all target groups are nil in normal scernarios,
so we can create targets[poolKey] outside the loop.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Mathilde Gilles
9b9c58aea8
[Consul] Add health label to metrics ( #5313 )
...
Label metrics with the target health using consul's /health endpoint.
Signed-off-by: Mathilde Gilles <m.gilles@criteo.com>
5 years ago
Frederic Branczyk
d06f1034db
discovery/kubernetes: Fix race in test setup
...
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
5 years ago
李国忠
029b45aa30
add service type metadata to kubernetes_sd_config service role #6496 ( #6684 )
...
* [service discovery] add service type metadata to kubernetes_sd_config service role
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
* [fix] ServiceType -> string
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
* [fix] fix testcase
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
* [style]
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
* [doc] add service type
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
* [doc] sort
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
5 years ago
Simon Pasquier
06c1a07d5a
discovery/kubernetes: remove extraneous parameters from send()
...
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
5 years ago
Aleksandra Gacek
8e53c19f9c
discovery/kubernetes: expose label_selector and field_selector
...
Close #6807
Co-authored-by @shuttie
Signed-off-by: Aleksandra Gacek <algacek@google.com>
5 years ago
Grebennikov Roman
b4445ff03f
discovery/kubernetes: expose label_selector and field_selector
...
Closes #6096
Signed-off-by: Grebennikov Roman <grv@dfdx.me>
5 years ago
Simon Pasquier
fe76ccbfe3
discovery/consul: fix logging of tags ( #6783 )
...
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
5 years ago
Ben Ye
1a18594176
keep kubernetes metrics in global vars ( #6765 )
...
Signed-off-by: yeya24 <yb532204897@gmail.com>
5 years ago
Ben Ye
60527de355
keep consul service metrics in global variables ( #6764 )
...
Signed-off-by: yeya24 <yb532204897@gmail.com>
5 years ago
Julien Pivotto
cf42888e4d
Fix order of testutil.Equals ( #6695 )
...
Equals takes the expected value as first parameter, and the actual value
as second parameter.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
johncming
17683d074c
discovery: fix bug that use rlock for read. ( #5928 )
...
Signed-off-by: johncming <johncming@yahoo.com>
5 years ago
Julien Pivotto
2b2eb79e8b
Add windows tests for query logger ( #6653 )
...
* Add windows tests
* Do not rely on time.Time in timer
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Josh Soref
91d76c8023
Spelling ( #6517 )
...
* spelling: alertmanager
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: attributes
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: autocomplete
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: bootstrap
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: caught
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: chunkenc
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: compaction
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: corrupted
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: deletable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: expected
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: fine-grained
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: initialized
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: iteration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: javascript
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: multiple
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: number
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: overlapping
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: possible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: postings
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: procedure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: programmatic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: queuing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: querier
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: repairing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: received
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: reproducible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: retention
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: sample
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: segements
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: semantic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: software [LICENSE]
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: staging
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: timestamp
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: unfortunately
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: uvarint
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: subsequently
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
* spelling: ressamples
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
5 years ago
Simon Pasquier
75470f86b4
discovery/kubernetes: fix client metrics
...
The Kubernetes client records workqueue duration and latency metrics as
seconds so there's no need to convert the values from microseconds to
seconds anymore.
The cache metrics (prometheus_sd_kubernetes_cache_*) are removed because
they aren't used anymore by the client though still exposed by its API.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
5 years ago
Callum Styan
7bf17b654c
As per dev summit, SD moratorium has been lifted. ( #6324 )
...
Signed-off-by: Callum Styan <callumstyan@gmail.com>
5 years ago