From 919558f601e60d797b02280a342b3a1f82b42f04 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 14 Jul 2016 09:54:10 +0900 Subject: [PATCH] config: remove deprecated `target_groups` configuration --- config/config.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/config/config.go b/config/config.go index 079d546a6..c9074fd1b 100644 --- a/config/config.go +++ b/config/config.go @@ -23,7 +23,6 @@ import ( "strings" "time" - "github.com/prometheus/common/log" "github.com/prometheus/common/model" "gopkg.in/yaml.v2" ) @@ -409,8 +408,6 @@ type ScrapeConfig struct { TLSConfig TLSConfig `yaml:"tls_config,omitempty"` // List of labeled target groups for this job. - // XXX(fabxc): `target_groups` is deprecated. - TargetGroups []*TargetGroup `yaml:"target_groups,omitempty"` StaticConfigs []*TargetGroup `yaml:"static_configs,omitempty"` // List of DNS service discovery configurations. DNSSDConfigs []*DNSSDConfig `yaml:"dns_sd_configs,omitempty"` @@ -460,14 +457,6 @@ func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { if c.BasicAuth != nil && (len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0) { return fmt.Errorf("at most one of basic_auth, bearer_token & bearer_token_file must be configured") } - // Check `target_groups` deprecation. - if c.TargetGroups != nil && c.StaticConfigs != nil { - return fmt.Errorf("'target_groups' is deprecated, configure static targets via 'static_configs' only") - } - if c.TargetGroups != nil { - log.Warnf("The 'target_groups' option for scrape configurations is deprecated, use 'static_configs' instead") - c.StaticConfigs = c.TargetGroups - } // Check for users putting URLs in target groups. if len(c.RelabelConfigs) == 0 { for _, tg := range c.StaticConfigs {