Merge branch 'master' of https://github.com/prometheus/prometheus into bug/target_label_unmarshal

This commit is contained in:
Matti Savolainen 2016-10-19 00:33:52 +03:00
commit 3b8e7c1277
4 changed files with 5 additions and 2 deletions

View File

@ -899,6 +899,7 @@ type EC2SDConfig struct {
SecretKey string `yaml:"secret_key,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
Port int `yaml:"port"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}
@ -928,6 +929,7 @@ type AzureSDConfig struct {
ClientID string `yaml:"client_id,omitempty"`
ClientSecret string `yaml:"client_secret,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
}

View File

@ -360,7 +360,7 @@ func TestLoadConfig(t *testing.T) {
// Parse a valid file that sets a global scrape timeout. This tests whether parsing
// an overwritten default field in the global config permanently changes the default.
if _, err := LoadFile("testdata/global_timeout.good.yml"); err != nil {
t.Errorf("Error parsing %s: %s", "testdata/conf.good.yml", err)
t.Errorf("Error parsing %s: %s", "testdata/global_timeout.good.yml", err)
}
c, err := LoadFile("testdata/conf.good.yml")

View File

@ -290,6 +290,7 @@ func (n *Notifier) sendAll(alerts ...*model.Alert) int {
}
defer resp.Body.Close()
// Any HTTP status 2xx is OK.
if resp.StatusCode/100 != 2 {
return fmt.Errorf("bad response status %v", resp.Status)
}

View File

@ -518,7 +518,7 @@ func (c *varbitChunk) addSecondSample(s model.SamplePair) ([]Chunk, error) {
return []Chunk{c}, nil
}
// addLastSample isa a helper method only used by c.add() and in other helper
// addLastSample is a helper method only used by c.add() and in other helper
// methods called by c.add(). It simply sets the given sample as the last sample
// in the heador and declares the chunk closed. In other words, addLastSample
// adds the very last sample added to this chunk ever, while setLastSample sets