481 Commits

Author SHA1 Message Date
Mitsuhiro Tanda
296644adeb Expose ec2_instance_type (#2107) 2016-10-21 11:13:47 +01:00
Dominik Schulz
36de163900 Add File-SD metrics (#2103)
* Add File-SD metrics

* Count read errors, not scan errors.
2016-10-21 11:12:19 +01:00
Dominik Schulz
3d0fb0cf17 Avoid too generic label type. 2016-10-21 12:11:15 +02:00
Dominik Schulz
e1e30f12cd Add Kubernetes-SD metrics. 2016-10-21 10:48:28 +02:00
Dominik Schulz
552ab61fa1 Change SD metric names to make logical grouping more visible. (#2102) 2016-10-21 09:18:28 +01:00
Dominik Schulz
0c69227616 Add Consul-SD metrics (#2097)
* Add Consul-SD metrics

* Remove unnecessary metric and add labels to summary.

* Do not stutter
2016-10-21 08:59:43 +01:00
Dominik Schulz
255a8c8b4c Fix small typo in EC2 SD metric name (#2100) 2016-10-20 09:01:00 +01:00
Dominik Schulz
00e486a05b Add Azure-SD metrics (#2099) 2016-10-20 08:23:50 +01:00
Dominik Schulz
163d5a8977 Add EC2 SD metrics (#2095)
* Add EC2 SD metrics

* Address review comments
2016-10-19 10:20:00 +01:00
Fabian Reinartz
3c8140f2e6 kubernetes: fix typo in endpoint switch case 2016-10-18 16:20:26 +02:00
bekbulatov
ac702f66eb Resolve merge conflicts 2016-10-18 14:14:24 +01:00
Fabian Reinartz
228bfc1bb5 Merge pull request #2040 from prometheus/kubernetes
Add K8S v2 pod discovery
2016-10-17 20:09:22 +02:00
Fabian Reinartz
ce45040e47 kubernetes: fix missing port labels
This commit fixes endpoint port labeling, adjusts tests accordingly
and enhances test delta printing
2016-10-17 11:05:13 +02:00
Frederic Branczyk
8f576a8510 retrieval: add kubernetes endpoint discovery tests 2016-10-17 10:32:10 +02:00
Frederic Branczyk
08fa4eaa92 retrieval: add kubernetes pod discovery tests 2016-10-17 10:32:10 +02:00
Frederic Branczyk
3762e39ce5 retrieval: add kubernetes service discovery tests 2016-10-17 10:32:10 +02:00
Frederic Branczyk
397072a482 retrieval: add kubernetes node discovery tests 2016-10-17 10:32:10 +02:00
Frederic Branczyk
cc46058802 retrieval: kubernetes nodes are not namespaced 2016-10-17 10:32:10 +02:00
Frederic Branczyk
a318d9ad27 retrieval: fix pod label and annotation prefixes 2016-10-17 10:32:10 +02:00
Fabian Reinartz
b24602f713 kubernetes: merge back into single configuration 2016-10-17 10:32:10 +02:00
Fabian Reinartz
a9cfb66b28 kubernetes: add node discovery 2016-10-17 10:32:10 +02:00
Fabian Reinartz
d896a654f9 kubernetes: Add discovery of services 2016-10-17 10:32:10 +02:00
Fabian Reinartz
6d269ed870 kubernetes: infer pod information in endpoints discovery 2016-10-17 10:32:10 +02:00
Fabian Reinartz
7c439a9060 kubernetes: use and vendor 1.5 client 2016-10-17 10:32:10 +02:00
Fabian Reinartz
de22524e57 kubernetes: add KubernetesV2 endpoints 2016-10-17 10:32:10 +02:00
Fabian Reinartz
2331701b50 kubernetes: Add K8S v2 pod discovery
This adds plumbing for a parallel version of the new K8S SD
and adds pod discovery as the first role.
2016-10-17 10:32:10 +02:00
Dominik Schulz
bfa7099616 Report GCE instance metdata (#2084)
* Report GCE instance metdata

* Fix spelling acording to code review guidelines

* Address review comments
2016-10-17 09:45:43 +02:00
Dominik Schulz
c73aa82589 Add GCE Instance Status 2016-10-08 08:40:12 +02:00
bekbulatov
01b53c1180 Add tls support 2016-10-07 13:40:22 +01:00
Roman Vynar
db63a4bd2a
Do not fail Consul discovery on Prometheus startup when Consul is down. 2016-09-26 22:20:56 +03:00
Dominik Schulz
f6fbcf9aa2 Expose ec2_instance_state 2016-09-22 15:01:23 +02:00
Tom Wilkie
4520e12440 Add HTTP Basic Auth & TLS support to the generic write path. (#1957)
* Add config, HTTP Basic Auth and TLS support to the generic write path.

- Move generic write path configuration to the config file
- Factor out config.TLSConfig -> tlf.Config translation
- Support TLSConfig for generic remote storage
- Rename Run to Start, and make it non-blocking.
- Dedupe code in httputil for TLS config.
- Make remote queue metrics global.
2016-09-19 22:47:51 +02:00
Matt Bostock
4fc619b605 Scrape: Remove JSON from Accept request header
JSON is no longer supported as an exposition format [1] [2] [3]. Remove
it from the `Accept` header added to requests when scraping targets.

[1]: https://github.com/prometheus/prometheus/blob/master/CHANGELOG.md#100--2016-07-18
[2]: https://prometheus.io/docs/instrumenting/exposition_formats/#historical-versions
[3]: https://docs.google.com/document/d/1ZjyKiKxZV83VI9ZKAXRGKaUKK2BIWCT7oiGBKDBpjEY/edit?usp=sharing
2016-09-17 10:28:03 +01:00
Ingo Gottwald
3b546d061f Add support for GCE discovery 2016-09-16 08:55:33 +02:00
Tobias Schmidt
29ced0090f Fix common english misspellings 2016-09-14 23:23:28 -04:00
Tobias Schmidt
27074863b4 Print url.URLs correctly in tests 2016-09-14 23:15:18 -04:00
Tobias Schmidt
8f3b62bfe4 Simplify struct initialization 2016-09-14 23:13:27 -04:00
Dan Milstein
0cb6b9962e Fix broken test which relied on DNS resolution #1962
Switched to testing by way of the static_configs rather than
dns_sd_config parameter.  Verified that the revised test both passes
without network access, and also still catches the bug it's supposed to
cover.
2016-09-08 16:59:46 -04:00
Fabian Reinartz
fec3b54cfc Merge pull request #1946 from prometheus/ipv6
Fix IPv6 scraping
2016-09-06 17:18:28 +02:00
Fabian Reinartz
a15237a0b8 retrieval: correctly handle IPv6 addresses
This updates all service discoveries to correctly
build the __address__ label for IPv6 addresses.
2016-09-06 15:06:49 +02:00
Fabian Reinartz
17cdd4f966 retrieval: fix IPv6 port default, add tests
This fixes port defaulting for IPv6 addresses and restructures
and test the construction of target label sets.
2016-09-06 15:06:48 +02:00
Fabian Reinartz
0322c59dc3 retrieval: export NewHTTPClient 2016-09-05 16:44:40 +02:00
Dan Milstein
b9fb9742ed Move test helper function into scope of test func 2016-08-29 16:08:40 -04:00
Dan Milstein
79216011cb Add basic test for TargetManager.targetSet
Verify that if the configs change, target groups are cleaned on
TargetManager.reload (rather than having old ones linger around, even if
they are no longer present in the configs).

This covers the bug fixed in #1907 -- I verified that by checking out
source from before that commit.

This is a start on #1906
2016-08-26 14:30:26 -04:00
Björn Rabenstein
4b8f963847 Merge pull request #1915 from prometheus/release-1.0
Forward-merge the bug fix from release-1.0
2016-08-24 13:04:45 +02:00
beorn7
e2b3626e0c retrieval: Clean up target group map on config reload
Also, remove unused `providers` field in targetSet.

If the config file changes, we recreate all providers (by calling
`providersFromConfig`) and retrieve all targets anew from the newly
created providers. From that perspective, it cannot harm to clean up
the target group map in the targetSet. Not doing so (as it was the
case so far) keeps stale targets around. This mattered if an existing
key in the target group map was not overwritten in the initial fetch
of all targets from the providers. Examples where that mattered:

```
scrape_configs:
- job_name: "foo"
  static_configs:
  - targets: ["foo:9090"]
  - targets: ["bar:9090"]
```
updated to:
```
scrape_configs:
- job_name: "foo"
  static_configs:
  - targets: ["foo:9090"]
```

`bar:9090` would still be monitored. (The static provider just
enumerates the target groups. If the number of target groups
decreases, the old ones stay around.

```
scrape_configs:
- job_name: "foo"
  dns_sd_configs:
  - names:
    - "srv.name.one.example.org"
```
updated to:
```
scrape_configs:
- job_name: "foo"
  dns_sd_configs:
  - names:
    - "srv.name.two.example.org"
```

Now both SRV records are still monitored. The SRV name is part of the
key in the target group map, thus the new one is just added and the
old ane stays around.

Obviously, this should have tests, and should have tests before, not
only for this case. This is the quick fix. I have created
https://github.com/prometheus/prometheus/issues/1906 to track test
creation.

Fixes https://github.com/prometheus/prometheus/issues/1610 .
2016-08-22 19:25:33 +02:00
Anders Daljord Morken
95cadd0702 Run scrape loop with interval 1 instead of 0
0 is considered an invalid interval by time.NewTicker() and will cause a
panic if control reaches that point. Given the vagaries of timekeeping,
this may occasionally happen and make this test unstable.
2016-08-18 09:39:11 +02:00
Anders Daljord Morken
8633ac180e Strip stray whitespace from bearer token file
Apart from not trying to send a newline in a HTTP header,
this also allows Prometheus to build and pass tests with Go 1.7,
which features stricter checking of HTTP headers.
2016-08-17 15:36:18 +02:00
Frederic Branczyk
7714b9c781 move relabeling functionality to its own package
also remove the returned error as it was always nil
2016-08-09 14:19:20 +02:00
Jimmi Dyson
6c8080607f
Kubernetes SD: Add node name and host IP to pod discovery 2016-07-20 12:00:54 +01:00