Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to v1.32.0 #144

Merged
merged 3 commits into from
Oct 15, 2024
Merged

Conversation

ezotrank
Copy link

@ezotrank ezotrank commented Oct 14, 2024

Conflicts during upgrade related to ElasticSearch CCR and Redis. The Redis one was removed, because this fix has been merged into upstream.

diff --cc plugins/inputs/elasticsearch/elasticsearch.go
index 9341abc56,2b1f65bdb..000000000
--- a/plugins/inputs/elasticsearch/elasticsearch.go
+++ b/plugins/inputs/elasticsearch/elasticsearch.go
@@@ -113,27 -133,25 +151,59 @@@ type indexStat struct 
  // Elasticsearch is a plugin to read stats from one or many Elasticsearch
  // servers.
  type Elasticsearch struct {
++<<<<<<< HEAD
 +	Local                      bool              `toml:"local"`
 +	Servers                    []string          `toml:"servers"`
 +	HTTPHeaders                map[string]string `toml:"headers"`
 +	HTTPTimeout                config.Duration   `toml:"http_timeout" deprecated:"1.29.0;1.35.0;use 'timeout' instead"`
 +	ClusterHealth              bool              `toml:"cluster_health"`
 +	ClusterHealthLevel         string            `toml:"cluster_health_level"`
 +	ClusterStats               bool              `toml:"cluster_stats"`
 +	ClusterStatsOnlyFromMaster bool              `toml:"cluster_stats_only_from_master"`
 +	EnrichStats                bool              `toml:"enrich_stats"`
 +	IndicesInclude             []string          `toml:"indices_include"`
 +	IndicesLevel               string            `toml:"indices_level"`
 +	NodeStats                  []string          `toml:"node_stats"`
 +	Username                   string            `toml:"username"`
 +	Password                   string            `toml:"password"`
 +	NumMostRecentIndices       int               `toml:"num_most_recent_indices"`
++||||||| parent of da0d5be15 (aiven: aiven patches)
++	Local                      bool            `toml:"local"`
++	Servers                    []string        `toml:"servers"`
++	HTTPTimeout                config.Duration `toml:"http_timeout"`
++	ClusterHealth              bool            `toml:"cluster_health"`
++	ClusterHealthLevel         string          `toml:"cluster_health_level"`
++	ClusterStats               bool            `toml:"cluster_stats"`
++	ClusterStatsOnlyFromMaster bool            `toml:"cluster_stats_only_from_master"`
++	IndicesInclude             []string        `toml:"indices_include"`
++	IndicesLevel               string          `toml:"indices_level"`
++	NodeStats                  []string        `toml:"node_stats"`
++	Username                   string          `toml:"username"`
++	Password                   string          `toml:"password"`
++	NumMostRecentIndices       int             `toml:"num_most_recent_indices"`
++=======
+ 	Local                      bool            `toml:"local"`
+ 	Servers                    []string        `toml:"servers"`
+ 	HTTPTimeout                config.Duration `toml:"http_timeout"`
+ 	ClusterHealth              bool            `toml:"cluster_health"`
+ 	ClusterHealthLevel         string          `toml:"cluster_health_level"`
+ 	ClusterStats               bool            `toml:"cluster_stats"`
+ 	ClusterStatsOnlyFromMaster bool            `toml:"cluster_stats_only_from_master"`
+ 	CCRStats                   bool            `toml:"ccr_stats"`
+ 	CCRStatsOnlyFromMaster     bool            `toml:"ccr_stats_only_from_master"`
+ 	IndicesInclude             []string        `toml:"indices_include"`
+ 	IndicesLevel               string          `toml:"indices_level"`
+ 	NodeStats                  []string        `toml:"node_stats"`
+ 	Username                   string          `toml:"username"`
+ 	Password                   string          `toml:"password"`
+ 	NumMostRecentIndices       int             `toml:"num_most_recent_indices"`
++>>>>>>> da0d5be15 (aiven: aiven patches)
  
 -	tls.ClientConfig
 +	Log telegraf.Logger `toml:"-"`
 +
 +	client *http.Client
 +	httpconfig.HTTPClientConfig
  
 -	client          *http.Client
  	serverInfo      map[string]serverInfo
  	serverInfoMutex sync.Mutex
  	indexMatchers   map[string]filter.Filter
@@@ -150,12 -168,10 +220,13 @@@ func (i serverInfo) isMaster() bool 
  // NewElasticsearch return a new instance of Elasticsearch
  func NewElasticsearch() *Elasticsearch {
  	return &Elasticsearch{
 -		HTTPTimeout:                config.Duration(time.Second * 5),
  		ClusterStatsOnlyFromMaster: true,
+ 		CCRStatsOnlyFromMaster:     true,
  		ClusterHealthLevel:         "indices",
 +		HTTPClientConfig: httpconfig.HTTPClientConfig{
 +			ResponseHeaderTimeout: config.Duration(5 * time.Second),
 +			Timeout:               config.Duration(5 * time.Second),
 +		},
  	}
  }
  
diff --cc plugins/inputs/elasticsearch/sample.conf
index 759017f63,a423ce90a..000000000
--- a/plugins/inputs/elasticsearch/sample.conf
+++ b/plugins/inputs/elasticsearch/sample.conf
@@@ -33,8 -29,11 +33,17 @@@
    ## To work this require local = true
    cluster_stats_only_from_master = true
  
++<<<<<<< HEAD
 +  ## Gather stats from the enrich API
 +  # enrich_stats = false
++||||||| parent of da0d5be15 (aiven: aiven patches)
++=======
+   ## Set ccr_stats to true when you want to obtain cross cluster replication stats.
+   ccr_stats = false
+ 
+   ## Only gather ccr_stats from the master node. To work this require local = true
+   ccr_stats_only_from_master = true
++>>>>>>> da0d5be15 (aiven: aiven patches)
  
    ## Indices to collect; can be one or more indices names or _all
    ## Use of wildcards is allowed. Use a wildcard at the end to retrieve index
diff --cc plugins/inputs/redis/redis.go
index ee577e7a6,8df5d6d31..000000000
--- a/plugins/inputs/redis/redis.go
+++ b/plugins/inputs/redis/redis.go
@@@ -664,19 -621,18 +666,39 @@@ func gatherErrorstatsLine
  		tags[k] = v
  	}
  	tags["err"] = strings.TrimPrefix(name, "errorstat_")
++<<<<<<< HEAD
 +	kv := strings.Split(line, "=")
 +	if len(kv) < 2 {
 +		acc.AddError(fmt.Errorf("invalid line for %q: %s", name, line))
 +		return
++||||||| parent of da0d5be15 (aiven: aiven patches)
++	kv := strings.Split(line, "=")
++	ival, err := strconv.ParseInt(kv[1], 10, 64)
++	if err == nil {
++		fields := map[string]interface{}{"total": ival}
++		acc.AddFields("redis_errorstat", fields, tags)
++=======
+ 	if strings.Contains(line, "=") {
+ 		kv := strings.Split(line, "=")
+ 		ival, err := strconv.ParseInt(kv[1], 10, 64)
+ 		if err == nil {
+ 			fields := map[string]interface{}{"total": ival}
+ 			acc.AddFields("redis_errorstat", fields, tags)
+ 		} else if log != nil {
+ 			log.Debugf("Error while parsing %v: %v", line, err)
+ 		}
+ 	} else if log != nil {
+ 		log.Debugf("Missing '=' in line %v (name:%v).", line, name)
++>>>>>>> da0d5be15 (aiven: aiven patches)
  	}
 +	ival, err := strconv.ParseInt(kv[1], 10, 64)
 +	if err != nil {
 +		acc.AddError(fmt.Errorf("parsing value in line %q failed: %w", line, err))
 +		return
 +	}
 +
 +	fields := map[string]interface{}{"total": ival}
 +	acc.AddFields("redis_errorstat", fields, tags)
  }
  
  func init() {
diff --cc plugins/inputs/redis/redis_test.go
index 0e96c49c3,eafae94a6..000000000
--- a/plugins/inputs/redis/redis_test.go
+++ b/plugins/inputs/redis/redis_test.go
@@@ -387,20 -371,22 +387,40 @@@ func TestRedis_ParseIntOnString(t *test
  
  func TestRedis_GatherErrorstatsLine(t *testing.T) {
  	var acc testutil.Accumulator
++<<<<<<< HEAD
 +	globalTags := map[string]string{}
 +
 +	gatherErrorstatsLine("FOO", "BAR", &acc, globalTags)
 +	require.Len(t, acc.Errors, 1)
 +	require.Equal(t, "invalid line for \"FOO\": BAR", acc.Errors[0].Error())
 +
 +	acc = testutil.Accumulator{}
 +	gatherErrorstatsLine("FOO", "BAR=a", &acc, globalTags)
 +	require.Len(t, acc.Errors, 1)
 +	require.Equal(t, "parsing value in line \"BAR=a\" failed: strconv.ParseInt: parsing \"a\": invalid syntax", acc.Errors[0].Error())
 +
 +	acc = testutil.Accumulator{}
 +	gatherErrorstatsLine("FOO", "BAR=77", &acc, globalTags)
 +	require.Empty(t, acc.Errors)
++||||||| parent of da0d5be15 (aiven: aiven patches)
++=======
+ 	var mockLogger testutil.CaptureLogger
+ 	globalTags := map[string]string{}
+ 
+ 	mockLogger.Clear()
+ 	gatherErrorstatsLine("FOO", "BAR", &acc, globalTags, &mockLogger)
+ 	require.Equal(t, 1, mockLogger.NMessages())
+ 	require.Equal(t, "Missing '=' in line BAR (name:FOO).", mockLogger.Messages()[0].Text)
+ 
+ 	mockLogger.Clear()
+ 	gatherErrorstatsLine("FOO", "BAR=a", &acc, globalTags, &mockLogger)
+ 	require.Equal(t, 1, mockLogger.NMessages())
+ 	require.Equal(t, "Error while parsing BAR=a: strconv.ParseInt: parsing \"a\": invalid syntax", mockLogger.Messages()[0].Text)
+ 
+ 	mockLogger.Clear()
+ 	gatherErrorstatsLine("FOO", "BAR=77", &acc, globalTags, &mockLogger)
+ 	require.Equal(t, 0, mockLogger.NMessages())
++>>>>>>> da0d5be15 (aiven: aiven patches)
  }
  
  const testOutput = `# Server

mhoffm-aiven and others added 2 commits October 2, 2024 14:35
see AIVEN_CHANGES.md for details
The extra metrics give a better view of what is happening
in the cluster.

The description of the too_many_tries_replicas metrics
was not accurate, this is fixed. Ideally the name should
be changed to, but that would break compatibility.
@ezotrank ezotrank marked this pull request as ready for review October 14, 2024 13:45
@ezotrank ezotrank self-assigned this Oct 14, 2024
Copy link

@RommelLayco RommelLayco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@RommelLayco RommelLayco merged commit cd662c6 into aiven-release-v1.32.0 Oct 15, 2024
2 of 5 checks passed
@ezotrank ezotrank deleted the kremenev/telegraf-v1.32.0 branch October 15, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants