Merge branch 'master' into clean-tomb

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-12-04 00:16:10 +05:30
commit 311edc5a38
6 changed files with 20 additions and 14 deletions

View File

@ -56,7 +56,7 @@ Prometheus will now be reachable at http://localhost:9090/.
### Building from source
To build Prometheus from the source code yourself you need to have a working
Go environment with [version 1.8 or greater installed](http://golang.org/doc/install).
Go environment with [version 1.9 or greater installed](http://golang.org/doc/install).
You can directly use the `go` tool to download and install the `prometheus`
and `promtool` binaries into your `GOPATH`:

View File

@ -289,7 +289,7 @@ func main() {
}
files = append(files, fs...)
}
return ruleManager.Update(time.Duration(cfg.GlobalConfig.EvaluationInterval), cfg.RuleFiles)
return ruleManager.Update(time.Duration(cfg.GlobalConfig.EvaluationInterval), files)
},
}

View File

@ -79,6 +79,7 @@ func testFileSD(t *testing.T, prefix, ext string, expect bool) {
if err != nil {
t.Fatal(err)
}
defer newf.Close()
f, err := os.Open(filepath.Join(testDir, prefix+ext))
if err != nil {
@ -90,14 +91,13 @@ func testFileSD(t *testing.T, prefix, ext string, expect bool) {
t.Fatal(err)
}
// File is written with the config so stop draining the discovery channel.
// It needs to be before the file closing so that fsnotify triggers a new loop of the discovery service.
// Test file is ready so stop draining the discovery channel.
// It contains two target groups.
close(fileReady)
<-drainReady
newf.Close()
newf.WriteString(" ") // One last meaningless write to trigger fsnotify and a new loop of the discovery service.
timeout := time.After(15 * time.Second)
// The files contain two target groups.
retry:
for {
select {
@ -105,7 +105,7 @@ retry:
if expect {
t.Fatalf("Expected new target group but got none")
} else {
// invalid type fsd should always broken down.
// Invalid type fsd should always break down.
break retry
}
case tgs := <-ch:

View File

@ -116,6 +116,9 @@ The following expression selects all metrics that have a name starting with `job
{__name__=~"job:.*"}
All regular expressions in Prometheus use [RE2
syntax](https://github.com/google/re2/wiki/Syntax).
### Range Vector Selectors
Range vector literals work like instant vector literals, except that they

View File

@ -31,6 +31,9 @@ Note that this does a substring match, not a full string match:
http_requests_total{job=~".*server"}
All regular expressions in Prometheus use [RE2
syntax](https://github.com/google/re2/wiki/Syntax).
To select all HTTP status codes except 4xx ones, you could run:
http_requests_total{status!~"4.."}

View File

@ -50,19 +50,19 @@ type status string
const (
statusSuccess status = "success"
statusError = "error"
statusError status = "error"
)
type errorType string
const (
errorNone errorType = ""
errorTimeout = "timeout"
errorCanceled = "canceled"
errorExec = "execution"
errorBadData = "bad_data"
errorInternal = "internal"
errorUnavailable = "unavailable"
errorTimeout errorType = "timeout"
errorCanceled errorType = "canceled"
errorExec errorType = "execution"
errorBadData errorType = "bad_data"
errorInternal errorType = "internal"
errorUnavailable errorType = "unavailable"
)
var corsHeaders = map[string]string{