Commit graph

331 commits

Author SHA1 Message Date
Donatas Abraitis 1aa8898b66 Allow number to be the first letter as well for job_name 2016-09-16 14:06:47 +03:00
Ingo Gottwald 3b546d061f Add support for GCE discovery 2016-09-16 08:55:33 +02:00
Alexey Miroshkin e29d9394e5 Forbid invalid relabel configurations
This fix adds check if target_label value is set in case if action is replace or
hashmod
Issue [#1900]
2016-08-29 16:56:06 +02:00
Fabian Reinartz be596f82b4 Merge pull request #1783 from knyar/json
Allow URLs in targets defined via a JSON file
2016-08-10 09:42:17 +02:00
Frederic Branczyk b655aa002f introduce top level alerting config node 2016-08-09 14:19:25 +02:00
Frederic Branczyk 679d225c8d allow relabeling of alerts
in case of dropping don't even enqueue them
2016-08-09 14:18:31 +02:00
Fabian Reinartz 7a0b3af0b7 config: validate Kubernetes role correctly. 2016-07-18 22:24:41 +09:00
Fabian Reinartz 919558f601 config: remove deprecated target_groups configuration 2016-07-14 09:55:00 +09:00
Fabian Reinartz 7221228843 discovery/kubernetes: select between discovery role
This adds `role` field to the Kubernetes SD config, which indicates
which type of Kubernetes SD should be run.
This no longer allows discovering pods and nodes with the same SD
configuration for example.
2016-07-05 14:22:12 +02:00
Anton Tolchanov 772a3af38f Allow URLs in targets defined via a JSON file
This enables defining `blackbox_exporter` targets (which can be URLs,
because of relabeling) in a JSON file.

Not sure if this is the best approach, but current behaviour is
inconsistent (`UnmarshalYAML` does not have this check) and breaks
officially documented way to use `blackbox_exporter`.
2016-07-04 00:05:57 +03:00
Ali Reza 98c156c361 reorder config validation, move checkOverflow before any other validation 2016-06-13 10:02:20 +07:00
Fabian Reinartz 0f21bd31ca config: deprecate target_groups for static_configs
This change deprecates the `target_groups` option in favor
of `static_configs`. The old configuration is still accepted
but prints a warning.
Configuration loading errors if both options are set.
2016-06-08 15:55:25 +02:00
Jimmi Dyson 206bcfcdaa
Kubernetes SD: Remove kubeletPort config option 2016-06-07 12:34:55 +01:00
Ali Reza c81b4e8a87 change config names to files for consistency 2016-05-30 07:47:58 +07:00
Gregory G. Tseng 7997c14b0d Add ServerName into TLS Config 2016-05-26 14:24:49 -07:00
Seth Miller 0988e3b937 Add support for Azure discovery
This change adds the ability to do target discovery with Microsoft's Azure platform.
2016-04-06 22:47:02 -05:00
Fabian Reinartz 37c709f917 Fix global config YAML issues 2016-02-15 14:08:25 +01:00
Fabian Reinartz 44a5e860ed Fix scrape timeout config checks 2016-02-15 12:07:46 +01:00
Julius Volz 829a029dda Update two more __meta_dns_srv_name references.
Although they are only in examples/tests and don't affect anything, they
could be confusing (the label has been renamed in the rest of the code a
while ago).
2016-02-14 22:20:39 +01:00
Fabian Reinartz e26e4b6e89 Restrict scrape timeout to interval length 2016-02-12 12:52:22 +01:00
beorn7 a7408bfb47 Unify duration parsing
It's actually happening in several places (and for flags, we use the
standard Go time.Duration...). This at least reduces all our
home-grown parsing to one place (in model).
2016-01-29 15:41:50 +01:00
Julien Dehee 061fe2f364 Support AirBnB's Smartstack Nerve client for SD
nerve's registration format differs from serverset. With this commit
there is now a dedicated treecache file in util,
and two separate files for serverset and nerve.

Reference:
https://github.com/airbnb/nerve
2016-01-18 14:07:28 +01:00
Fabian Reinartz 4d1c9296d5 Add new defaults for relabel configurations 2015-11-16 13:16:13 +01:00
Brian Brazil fd2bd81cd8 Allow all instance labels in target groups
With the blackbox exporter, the instance label will commonly
be used for things other than hostnames so remove this restriction.
https://example.com or https://example.com/probe/me are some examples.

To prevent user error, check that urls aren't provided as targets
when there's no relabelling that could potentically fix them.
2015-11-07 14:35:20 +00:00
Fabian Reinartz f2a8261cdb Merge pull request #1177 from fabric8io/kubernetes-discovery
Kubernetes SD authentication options cleanup
2015-10-24 20:32:25 +02:00
Fabian Reinartz 180da1ba65 Add overflow check in TLS config 2015-10-24 17:12:34 +02:00
Jimmi Dyson 87940ec213 Kubernetes SD: Rename masters to api_servers in config 2015-10-24 14:41:14 +01:00
Jimmi Dyson 7ff5cc66ea Kubernetes SD authentication options cleanup 2015-10-23 16:47:52 +01:00
Brian Brazil 1ddf75240d config: Don't hide username, it's not secret.
Usernames are not generally considered to be secrets,
and treating them as secrets may lead to confusion
as to how secure they are. Obscuring them also makes
debugging harder.
2015-10-08 15:13:21 +01:00
Matt Jibson dcb4856d72 Add SD for Amazon EC2 instances 2015-10-06 18:36:17 -04:00
Julius Volz dac26cef71 Rename global "labels" config option to "external_labels". 2015-09-29 20:54:20 +02:00
Matt Jibson 0e99fa6c46 Allow labelmap action 2015-09-21 15:41:19 -04:00
Jimmi Dyson ec04ba38a2 Kubernetes SD config check 2015-09-09 13:24:44 +01:00
Jimmi Dyson a1574aa2b3 Move TLS options to scrape config
Fixes #1013, fixes #989
2015-09-09 09:52:21 +01:00
Fabian Reinartz 1ef5ed0cf2 Merge pull request #1048 from xperimental/fix/marathon-config
Fix parsing Marathon SD config
2015-09-06 20:09:46 +02:00
Robert Jacob eb7416e71f Fix missing unmarshal for Marathon SD config. 2015-09-06 20:02:22 +02:00
Jimmi Dyson d7a7fd4589 Kubernetes SD improvements
* Support multiple masters with retries against each master as required.
* Scrape masters' metrics.
* Add role meta label for node/service/master to make it easier for relabeling.
2015-09-04 11:31:20 +01:00
Julius Volz f63a899744 Change config regexes to full-string matches.
This anchors all regular expressions entered via the config to match a
full string vs. a substring.

THIS IS A BREAKING CHANGE!

Fixes part of https://github.com/prometheus/prometheus/issues/996
2015-09-01 15:46:41 +02:00
Julius Volz 995d3b831d Fix most golint warnings.
This is with `golint -min_confidence=0.5`.

I left several lint warnings untouched because they were either
incorrect or I felt it was better not to change them at the moment.
2015-08-26 12:44:46 +02:00
Fabian Reinartz 438e232c9b Fix grouping of import blocks 2015-08-22 09:42:45 +02:00
Fabian Reinartz 306e8468a0 Switch from client_golang/model to common/model 2015-08-21 13:33:38 +02:00
Fabian Reinartz ac0be60bb9 Add license headers 2015-08-20 13:03:56 +02:00
Fabian Reinartz 139f27bf8a Increase default retry interval for file SD
The automatic refresh is a safety mechanism in case
file watches fail. As they seem to be working well the
interval can be increased.
2015-08-16 15:06:26 +02:00
Fabian Reinartz 3c6dd161d7 Scrape all services on empty services list. 2015-08-14 17:39:41 +02:00
Fabian Reinartz b964da4b75 Merge pull request #905 from fabric8io/kubernetes-discovery
Kubernetes discovery
2015-08-13 15:08:32 +02:00
Fabian Reinartz 24e91720ad Merge pull request #980 from prometheus/map-labels
Retrieval: Add relabel action to map labels names with a regex.
2015-08-13 14:36:59 +02:00
Brian Brazil 4e70a0a14e Retrieval: Add relabel action to map label names with a regex.
The intended use case is where a user has tags/labels coming
from metadata in Kubernetes or EC2, and wants to make
some subset of them into target labels.
2015-08-13 13:19:11 +01:00
Brian Brazil 43449b0581 config: Update tests/examples to use __tmp_ 2015-08-13 10:39:21 +01:00
Jimmi Dyson 923f8111d4 Initial Kubernetes discovery
Fixes #904
2015-08-13 10:38:52 +01:00
Fabian Reinartz cdcfada2ac Merge pull request #965 from prometheus/fabxc/relpath
Resolve relative paths on configuration loading
2015-08-10 19:43:42 +02:00
Fabian Reinartz 73f1cc807d Check token and cert file existence in promtool 2015-08-10 11:42:29 +02:00
Fabian Reinartz 54202bc5a8 Merge pull request #902 from xperimental/feature/marathon-discovery
retrieval/discovery: Service discovery using marathon API
2015-08-10 01:43:37 +02:00
Robert Jacob 4d0f974c42 Add service discovery using Marathon API. 2015-08-10 01:36:24 +02:00
Will Rouesnel 7810448dbe Add proxy_url parameter to allow specifying per-job HTTP proxy servers
Allow scrape_configs to have an optional proxy_url option which specifies
a proxy to be used for all connections to hosts in that config.

Internally this modifies the various client functions to take a *url.URL pointer
which currently must point to an HTTP proxy (but has been left open-ended to
allow the url format to be extended to support others, such as maybe SOCKS if
needed).
2015-08-08 04:29:27 +10:00
Fabian Reinartz 7a67472fc1 Resolve relative paths on configuration loading
This moves the concern of resolving the files relative to the config
file into the configuration loading itself.
It also fixes #921 which did not load the cert and token files relatively.
2015-08-05 18:08:04 +02:00
Jimmi Dyson 52cf6b3e6e Configuration options for bearer tokens, client certs & CA certs
Fixes #918, fixes #917
2015-08-04 17:18:46 +01:00
Johannes 'fish' Ziemke 9ab340e95e Add support for A record based DNS SD
If using A records, the user needs to specify "port" and set "type" to
"A".
2015-07-30 15:55:38 +02:00
Fabian Reinartz 187fe4e3d3 Fix missing defaults for empty global config blocks 2015-07-17 21:25:56 +02:00
Fabian Reinartz 2a53b107c1 Fix missing defaults in empty configurations 2015-07-17 19:15:01 +02:00
Fabian Reinartz 435fc7234f config: add overflow detection for serverset config 2015-07-14 02:46:00 +02:00
Fabian Reinartz 02e06839f2 config: hide authentication credentials in String() output 2015-07-06 14:28:07 +02:00
Brian Brazil 52859b8033 Merge pull request #836 from prometheus/shard
Add 'hashmod' relabel action.
2015-06-24 21:40:10 +01:00
Brian Brazil 682f949ab1 Add 'hashmod' relabel action.
This takes the modulus of a hash of some labels.
Combined with a keep relabel action, this allows
for sharding of targets across multiple prometheus
servers.
2015-06-24 21:14:53 +01:00
Fabian Reinartz 4319b06dd2 config: add omitempty for consul SD config. 2015-06-24 16:22:52 +02:00
Fabian Reinartz 7ec15956e4 config: show original input on String() 2015-06-23 19:40:44 +02:00
Fabian Reinartz dc7d27ab9a retrieval: add honor label handling and parametrized querying.
This commit adds the honor_labels and params arguments to the scrape
config. This allows to specify query parameters used by the scrapers
and handling scraped labels with precedence.
2015-06-23 13:45:14 +02:00
Brian Brazil 4d895242f9 Add support for Zookeeper Serversets for SD.
It can discover an entire tree of serversets, or just one.
2015-06-16 11:02:08 +01:00
Brian Brazil 0dbae36d36 Allow ingested metrics to be relabeled.
The main purpose of this is to allow for blacklisting
of expensive metrics as a tactical option.
It could also find uses for renaming and removing labels
from federation.
2015-06-13 15:18:27 +01:00
Brian Brazil 58ceae82bc Revert "Allow ingested metrics to be relabeled."
This reverts commit f2f26ca08f.

Was accidentally pushed to master instead of a branch for PR.
2015-06-12 22:12:26 +01:00
Brian Brazil f2f26ca08f Allow ingested metrics to be relabeled.
The main purpose of this is to allow for blacklisting
of expensive metrics as a tactical option.
It could also find uses for renaming and removing labels
from federation.
2015-06-12 22:06:30 +01:00
Fabian Reinartz 116e6df096 config: raise error on unknown config parameters.
The YAML parser ignores additional parameters on unmarshaling. This causes
frequent confusion with bad configs that pass parsing.
These changes raise errors on additional parameters.
2015-06-12 13:42:56 +02:00
Fabian Reinartz 3a24a7779d config: extend and format config example/test. 2015-06-12 13:39:12 +02:00
Fabian Reinartz 458550560c config: error on missing regex in relabel config.
Fixes issue #787.
2015-06-10 23:42:51 +02:00
Fabian Reinartz b5fe2e9afe Merge pull request #773 from prometheus/fabxc/simple-cfg
config: simplify default config handling.
2015-06-08 16:22:06 +02:00
Fabian Reinartz f6c33a2347 config: prevent overwrite of DefaultGlobalConfig 2015-06-08 16:02:10 +02:00
Fabian Reinartz db3367e83f config: ensure correct labelname in JSON target group. 2015-06-06 10:08:42 +02:00
Fabian Reinartz 0af1cff8af config: simplify default config handling. 2015-06-06 09:04:04 +02:00
Fabian Reinartz 17c4c8ed95 config: fix json/yaml tag inconsistencies. 2015-06-02 18:21:19 +02:00
Fabian Reinartz 867f2ac979 Merge pull request #762 from prometheus/0.14.1
0.14.1
2015-06-02 13:24:12 +02:00
Joonas Bergius 5d5c3878ed Restore default ScrapeInterval of 1 minute instead of 10 seconds 2015-06-01 22:41:33 -04:00
Fabian Reinartz 0de6edbdfc Move pkg/ to util/ 2015-06-01 21:12:32 +02:00
Fabian Reinartz dbc0d30e3e Move string functionality to pkg/strutil 2015-06-01 21:12:32 +02:00
Fabian Reinartz c44ac7bc26 Load rule files from entire directories 2015-06-01 21:12:31 +02:00
Fabian Reinartz ed6572fc0c Fix typos 2015-06-01 21:12:31 +02:00
Fabian Reinartz b0c181dc0d Add Consul SD configuration. 2015-05-20 11:46:24 +02:00
Fabian Reinartz 93548a8882 Add initial file based service discovery.
This commits adds file based service discovery which reads target
groups from specified files. It detects changes based on file watches
and regular refreshes.
2015-05-15 14:44:54 +02:00
Fabian Reinartz 3b21c7037a Add file SD to configuration. 2015-05-15 14:44:54 +02:00
Fabian Reinartz d5aa012fd0 Make HTTP basic auth configurable for scrape targets. 2015-05-15 12:47:50 +02:00
Fabian Reinartz 86087120dd Replace example config with new YAML format. 2015-05-11 18:14:07 +02:00
Fabian Reinartz 5fbde88919 Switch config to YAML format. 2015-05-07 16:52:14 +02:00
Fabian Reinartz b5a8f7b8fa Cleanup, test, and document config. 2015-04-30 21:17:19 +02:00
Fabian Reinartz 945c49a2dd Add relabelling to target management.
This commit adds a relabelling stage on the set of base
labels from which a target is created. It allows to drop
targets and rewrite any regular or internal label.
2015-04-30 18:46:33 +02:00
Fabian Reinartz 0b619b46d6 Change JobConfig to ScrapeConfig.
This commit changes the configuration interface from job configs to scrape
configs. This includes allowing multiple ways of target definition at once
and moving DNS SD to its own config message. DNS SD can now contain multiple
DNS names per configured discovery.
2015-04-28 23:18:55 +02:00
Fabian Reinartz 5015c2a0e8 Make target manager source based.
This commit shifts responsibility for maintaining targets from providers and
pools to the target manager. Target groups have a source name that identifies
them for updates.
2015-04-24 15:49:35 +02:00
Fabian Reinartz 4f8673aa88 Simplify update sync for targets, format config fixtures. 2015-04-19 10:36:26 +02:00
Fabian Reinartz 0280d74167 Fix scrape timeout in config.
The scrape timeout helper was wrapping the scrape interval.
2015-04-15 13:46:27 +02:00
Julius Volz 464524fa44 Make config/Makefile use user Go installation.
Otherwise it will fail to "go get" the "github.com/golang/protobuf"
package because its dir already exists in the vendored packages,
but the copy isn't a git repository.
2015-02-17 02:20:16 +01:00
Julius Volz af627bb2b9 Copy vendored deps manually instead of using Godeps.
We were using Godep incorrectly (cloning repos from the internet during
build time instead of including Godeps/_workspace in the GOPATH via
"godep go"). However, to avoid even having to fetch "godeps" from the
internet during build, this now just copies the vendored files into the
GOPATH.

Also, the protocol buffer library moved from Google Code to GitHub,
which is reflected in these updates.

This fixes https://github.com/prometheus/prometheus/issues/525
2015-02-17 02:08:56 +01:00
Bjoern Rabenstein cf28c2efbb Change autogenerated protobuf code. 2015-01-23 14:44:30 +01:00
Bjoern Rabenstein 5859b74f1b Clean up license issues.
- Move CONTRIBUTORS.md to the more common AUTHORS.
- Added the required NOTICE file.
- Changed "Prometheus Team" to "The Prometheus Authors".
- Reverted the erroneous changes to the Apache License.
2015-01-21 20:07:45 +01:00
Bjoern Rabenstein 39efe6358b Fix typos and import order.
This doesn't make the import order consistend everywhere, just where
it was touched by the previous commit.

Change-Id: I82fc75f8691da9901c7ceb808e6f6fe8e5d62c0e
2014-12-10 17:46:56 +01:00
Bjoern Rabenstein b1e4956142 Apply a giant code cleanup.
Essentially:

- Remove unused code.

- Make it 'go vet' clean. The only remaining warnings are in generated code.

- Make it 'golint' clean. The only remaining warnings are in gerenated code.

- Smoothed out same minor things.

Change-Id: I3fe5c1fbead27b0e7a9c247fee2f5a45bc2d42c6
2014-12-10 16:16:49 +01:00
Bjoern Rabenstein 006b5517e2 Simplify makefiles.
This removes the dependancy on C leveldb and snappy.
It also takes care of fewer dependencies as they would
anyway not work on any non-Debian, non-Brew system.

Change-Id: Ia70dce1ba8a816a003587927e0b3a3f8ad2fd28c
2014-11-25 17:10:39 +01:00
Julius Volz 7b013e6491 Merge "Replace some uses of obsolete /metrics.json with /metrics (haven't touched test files yet)." 2013-12-18 16:56:30 +01:00
Julius Volz 78ebc1a61f Ensure that job names are unique in parsed configs.
Change-Id: I6bd89e6401bd924315981db797af21bdf0b81252
2013-12-03 12:10:22 +01:00
Conor Hennessy aada5ded85 Replace some uses of obsolete /metrics.json with /metrics
(haven't touched test files yet).

Change-Id: I48c7c0cf27a39d596627a06cbb4f5913fb3da13c
2013-10-22 20:54:43 +02:00
Conor Hennessy 2d26db7e37 Trivial regeneration of config proto (wasn't regenerated with new comments).
Change-Id: Iaa97c8b96b40b7f13884e85a39d5a229c2d33f37
2013-10-10 20:58:30 +02:00
Julius Volz 788587426b Make scrape timeouts configurable per job.
Change-Id: I77a7514ad9e7969771f873d63d6353ec50082a62
2013-08-19 12:21:47 +02:00
Julius Volz d69b85e6c9 Add global label support via Ingesters. 2013-08-13 16:54:15 +02:00
Julius Volz c03712dc58 Update config.pb.go (now includes comments from protobuf definition file). 2013-08-07 20:18:20 +02:00
Julius Volz a310afd28f Update "build" -> ".build" in remaining Makefiles. 2013-06-26 16:09:37 +02:00
Julius Volz 1cf9e5840a Fix whitespace in config.proto. 2013-06-26 11:49:49 +02:00
Matt T. Proud f895acb9ef Trailing build system cleanups.
The .gitignore files had problems, and the build steps could be
simplified.
2013-06-13 15:38:03 +02:00
Julius Volz d9b4f98b44 Integrate DNS-SD support for discovering job targets. 2013-06-12 18:11:48 +02:00
Matt T. Proud 8f4c7ece92 Destroy naked returns in half of corpus.
The use of naked return values is frowned upon.  This is the first
of two bulk updates to remove them.
2013-05-16 10:53:25 +03:00
Matt T. Proud 161c8fbf9b Include deletion processor for long-tail values.
This commit extracts the model.Values truncation behavior into the actual
tiered storage, which uses it and behaves in a peculiar way—notably the
retention of previous elements if the chunk were to ever go empty.  This is
done to enable interpolation between sparse sample values in the evaluation
cycle.  Nothing necessarily new here—just an extraction.

Now, the model.Values TruncateBefore functionality would do what a user
would expect without any surprises, which is required for the
DeletionProcessor, which may decide to split a large chunk in two if it
determines that the chunk contains the cut-off time.
2013-05-10 12:19:12 +02:00
Matt T. Proud 38d839d810 Include generated Protocol Buffers artifacts.
This commit reduces the general compile time dependencies to omit
the Protocol Buffer compiler and the Go Protocol Buffer generator
tool.  The build steps to furnish them still remain, but they can
optionally be called if data.proto or config.proto are under work.
2013-05-08 21:16:39 +02:00
Julius Volz 9cea5d9df8 Convert the Prometheus configuration to protocol buffers. 2013-04-30 22:26:00 +02:00
Julius Volz c0601abf46 Implement initial no-op alert parsing and rule parsing tests. 2013-04-23 13:48:24 +02:00
Julius Volz f1fc7d717a Allow replacing job targets via HTTP API.
This roughly comprises the following changes:

- index target pools by job instead of scrape interval
- make targets within a pool exchangable while preserving existing
  health state for targets
- allow exchanging targets via HTTP API (PUT)
- show target lists in /status (experimental, for own debug use)
2013-02-28 21:33:29 +01:00
Julius Volz 39411b516d Add missing config test fixtures. 2013-02-17 01:01:50 +01:00
Julius Volz d137362257 Config tests and config cleanups+fixes. 2013-02-14 19:03:17 +01:00
Julius Volz c3d31febd6 Move durationToString to common place and cleanup error handling. 2013-02-14 19:02:23 +01:00
Julius Volz 06ace4941d Remove/replace last references to github.com/matttproud/... 2013-02-07 14:32:18 +01:00
Julius Volz 16d9dcd6a8 Add copyright notices to all remaining files. 2013-02-07 11:49:04 +01:00
Matt T. Proud ea54751431 Update import paths to new location.
This repository moved from matttproud/prometheus to
prometheus/prometheus, and all import paths need to be updated.
2013-01-27 18:49:45 +01:00
Tobias Schmidt 6523536758 Fix bug in config.LoadFromFile if file is not present 2013-01-25 00:41:10 +01:00
Julius Volz a555ded2b3 Add "w" (weeks) as a valid timeunit. 2013-01-22 02:27:26 +01:00
Matt T. Proud efe61c18fa Refactor target scheduling to separate facility.
``Target`` will be refactored down the road to support various
nuanced endpoint types.  Thusly incorporating the scheduling
behavior within it will be problematic.  To that end, the scheduling
behavior has been moved into a separate assistance type to improve
conciseness and testability.

``make format`` was also run.
2013-01-13 10:43:37 +01:00
Julius Volz cb6eb30182 Fix state cleanup bug between rule/config parser runs.
This fixes a bug that has been annoying me minorly for some time now:
sometimes, after parse errors, a subsequent parser run would fail.  The reason
is that yylex() modifies some global variables (yytext, yydata) during its run
to keep state. To make subsequent parser runs correct, these have to be reset
before each run.

Also, close files after reading them.
2013-01-12 02:35:40 +01:00
Julius Volz 56384bf42a Add initial config and rule language implementation. 2013-01-07 23:43:36 +01:00