Commit Graph

3659 Commits

Author SHA1 Message Date
Stephen Soltesz
3f29324e04 Fix kubernetes host:port relabel regex.
This change corrects a bug introduced by PR
https://github.com/prometheus/prometheus/pull/2427

The regex uses three groups: the hostname, an optional port, and the
prefered port from a kubernetes annotation.

Previously, the second group should have been ignored if a :port was not
present in the input. However, making the port group optional with the
"?" had the unintended side-effect of allowing the hostname regex "(.+)"
to match greedily, which included the ":port" patterns up to the ";"
separating the hostname from the kubernetes port annotation.

This change updates the regex for the hostname to match any non-":"
characters. This forces the regex to stop if a ":port" is present and
allow the second group to match the optional port.
2017-02-16 14:46:04 -05:00
Tobias Schmidt
0436e982cb Merge pull request #2427 from stephen-soltesz/master
Kubernetes port annotations - match addresses with or without declared ports
2017-02-14 22:45:30 -05:00
Stephen Soltesz
0b1790ee44 Match addresses with or without declared ports.
This change updates port relabeling for pod and service discovery so the
relabeling regex matches addresses with or without declared ports. As
well, this change uses a consistent style in the replacement pattern
for the two expressions.

Previously, for both services or pods that did not have declared ports, the
relabel config regex would fail to match:

    __meta_kubernetes_service_annotation_prometheus_io_port
    regex: (.+)(?::\d+);(\d+)

    __meta_kubernetes_pod_annotation_prometheus_io_port
    regex: (.+):(?:\d+);(\d+)

Both regexes expected a <host>:<port> pattern.

The new regex matches addresses with or without declared ports by making
the :<port> pattern optional.

    __meta_kubernetes_service_annotation_prometheus_io_port
    __meta_kubernetes_pod_annotation_prometheus_io_port
    regex: (.+)(?::\d+)?;(\d+)
2017-02-14 20:12:38 -05:00
Björn Rabenstein
a37d39c463 Merge pull request #2425 from prometheus/beorn7/vendoring
vendoring: Do not ignore appengine build tags
2017-02-14 22:14:27 +01:00
Julius Volz
980586d183 Merge pull request #2419 from prometheus/remove-legacy-remotes
Remove legacy remote storage implementations
2017-02-14 18:35:39 +01:00
beorn7
b4ce5ca925 vendoring: Do not ignore appengine build tags
For weird reasons, this excluded github.com/miekg/dns/udp_other.go
from vendoring.
2017-02-14 18:32:07 +01:00
Julius Volz
beb3c4b389 Remove legacy remote storage implementations
This removes legacy support for specific remote storage systems in favor
of only offering the generic remote write protocol. An example bridge
application that translates from the generic protocol to each of those
legacy backends is still provided at:

documentation/examples/remote_storage/remote_storage_bridge

See also https://github.com/prometheus/prometheus/issues/10

The next step in the plan is to re-add support for multiple remote
storages.
2017-02-14 17:52:05 +01:00
Björn Rabenstein
0f412e7e26 Merge pull request #2422 from levenlabs/nameList
discovery: Instead of looping over conf.Search, use NameList()
2017-02-14 17:48:06 +01:00
James Hartig
865f28bb15 discovery: Instead of looping over conf.Search, use NameList() 2017-02-13 15:48:51 -05:00
James Hartig
e7ce10d4e5 vendoring: Update github.com/miekg/dns
This is needed to get the NameList function to get query names
2017-02-13 15:40:45 -05:00
Alex Somesan
18cd7246b5 Instrument query engine timings (#2418)
* Instrument query engine statistics
2017-02-13 16:45:00 +00:00
beorn7
e7c8a612de Merge branch 'release-1.5' 2017-02-10 15:45:54 +01:00
Björn Rabenstein
bd1182d29f Merge pull request #2415 from prometheus/beorn7/release
Cut v1.5.2
2017-02-10 15:34:18 +01:00
beorn7
6c17d30688 Cut v1.5.2 2017-02-10 13:57:11 +01:00
beorn7
d3297e0686 build: Use Go1.7.4 in Travis 2017-02-10 13:05:32 +01:00
beorn7
abf1d6e413 storage: Fix typo in doc comment 2017-02-10 12:44:57 +01:00
Björn Rabenstein
b4450f02bc Merge pull request #2414 from prometheus/beorn7/storage
storage: Fix chunkIndexToStartSeek calculation
2017-02-10 12:43:00 +01:00
beorn7
d771185a43 storage: Fix chunkIndexToStartSeek calculation
With a high enough shrink ratio and enough chunks to persist, the
cutoff point could be _outside_ of the file, which wreaks havoc in the
storage.
2017-02-10 11:42:59 +01:00
Björn Rabenstein
342f970e05 Merge pull request #2413 from prometheus/beorn7/storage
storage: Fix offset returned by dropAndPersistChunks
2017-02-09 15:54:52 +01:00
beorn7
73bd5e4dff Merge branch 'beorn7/storage' into beorn7/storage3 2017-02-09 14:44:10 +01:00
beorn7
46a0837816 storage: Fix offset returned by dropAndPersistChunks
This is another corner-case that was previously never exercised
because the rewriting of a series file was never prevented by the
shrink ratio.

Scenario: There is an existing series on disk, which is archived. If a
new sample comes in for that file, a new chunk in memory is created,
and the chunkDescsOffset is set to -1. If series maintenance happens
before the series has at least one chunk to persist _and_ an
insufficient chunks on disk is old enough for purging (so that the
shrink ratio kicks in), dropAndPersistChunks would return 0, but it
should return the chunk length of the series file.
2017-02-09 14:35:07 +01:00
beorn7
9d12204da5 Merge branch 'release-1.5' 2017-02-09 13:11:53 +01:00
Björn Rabenstein
0c688ab339 Merge pull request #2412 from prometheus/beorn7/storage
storage: One more persist error code path discovered
2017-02-09 13:09:41 +01:00
beorn7
bed4934224 storage: One more persist error code path discovered
Also, in that code path, set chunkDescsOffset to 0 rather than -1 in
case of "dropped more chunks from persistence than from memory" so
that no other weird things happen before the series is quarantined for
good.
2017-02-09 11:51:40 +01:00
beorn7
242d8edcb5 Merge branch 'release-1.5' 2017-02-08 17:28:09 +01:00
Björn Rabenstein
eac9696a36 Merge pull request #2410 from prometheus/beorn7/storage
storage: writeMemorySeries needs to return true for quarantined series
2017-02-08 17:27:43 +01:00
beorn7
8c8baaa558 storage: writeMemorySeries needs to return true for quarantined series
This is another fallout of my bug hunt.
2017-02-08 16:28:56 +01:00
Mitsuhiro Tanda
be8b1eb656 storage: optimize dropping chunks by using minShrinkRatio (#2397)
storage: prevent unnecessary chunk header reading if minShrinkRatio > 0
2017-02-07 17:33:54 +01:00
beorn7
85268a55c0 Merge branch 'release-1.5' 2017-02-07 12:10:40 +01:00
Björn Rabenstein
c4686f7915 Merge pull request #2403 from prometheus/beorn7/release
Cut release 1.5.1
2017-02-07 11:54:26 +01:00
beorn7
eb6b95ac2e Cut release 1.5.1
Sadly, this is urgently required.
2017-02-07 10:55:01 +01:00
beorn7
0f3d37ca4c Merge branch 'release-1.5' 2017-02-07 00:22:40 +01:00
Björn Rabenstein
3e133a9312 Merge pull request #2400 from prometheus/beorn7/storage2
storage: Fix checkpointing of fully persisted memory series.
2017-02-07 00:21:14 +01:00
Fabian Reinartz
e4f58d9860 Merge pull request #2401 from svend/kubernetes-config
Kubernetes SD: Fix namespace meta label in example config
2017-02-06 23:25:37 +01:00
Svend Sorensen
3a96d0e267 Kubernetes SD: Fix namespace meta label
Replace one more instance of `__meta_kubernetes_service_namespace` with
`__meta_kubernetes_namespace`.
2017-02-06 13:28:12 -08:00
beorn7
2363a90adc storage: Do not throw away fully persisted memory series in checkpointing 2017-02-06 17:39:59 +01:00
beorn7
244a65fb29 storage: Increase persist watermark before calling append
The append call may reuse cds, and thus change its len.
(In practice, this wouldn't happen as cds should have len==cap.
Still, the previous order of lines was problematic.)
2017-02-05 02:25:09 +01:00
beorn7
75282b27ba storage: Added checks for invariants 2017-02-04 23:40:22 +01:00
beorn7
31e9db7f0c storage: Simplify evictChunkDesc method 2017-02-04 22:29:37 +01:00
beorn7
65dc8f44d3 storage: Test for errors returned by MaybePopulateLastTime 2017-02-01 23:43:58 +01:00
beorn7
752fac60ae storage: Remove race condition from TestLoop 2017-02-01 23:43:58 +01:00
beorn7
4daffbef12 Merge branch 'release-1.5'
This merges forward the bug-fixes from the release1.5 branch.
2017-02-01 23:43:05 +01:00
Brian Brazil
34767c2221 Clone lset before relabelling. (#2386)
We need to not change the lset passed into populateLabels, as that
is kept around by the SDs.

Fixes 2377
2017-02-01 19:49:50 +00:00
Björn Rabenstein
7db4447390 Merge pull request #2385 from prometheus/beorn7/storage
Fix embarrassing bug of not setting the shrink ratio
2017-02-01 16:58:56 +01:00
beorn7
4ccfc93dcf storage: Set shrink ratio in the constructor. 2017-02-01 15:37:16 +01:00
beorn7
b2f086c6c4 storage: Expose bug of not setting the shrink ratio in the contstructor 2017-02-01 15:37:10 +01:00
Julius Volz
d5f6079029 Merge pull request #2381 from prometheus/remote-storage-bridge-example
Add standalone remote storage bridge example
2017-02-01 13:23:06 +01:00
Julius Volz
b16371595d Add standalone remote storage bridge example
In preparation for removing specific remote storage implementations,
this offers an example of how to achieve the same in a separate process.
Rather than having three separate bridges for OpenTSDB, InfluxDB, and
Graphite, I decided to support all in one binary.

For now, this is in the example documenation directory, but perhaps we
will want to make a first-class project / repository out of it.
2017-02-01 13:22:41 +01:00
Julius Volz
5e985f24de Merge pull request #2179 from prometheus/update-mailing-list-ref
Replace mailing list / IRC mention with link to Community page
2017-01-26 17:08:16 +01:00
Julius Volz
2e1d8dd6bd Replace mailing list / IRC mention with link to Community page 2017-01-26 17:07:27 +01:00