diff --git a/plugin/storage/es/options.go b/plugin/storage/es/options.go index 06da56a3d8f5..9dfb34f6c642 100644 --- a/plugin/storage/es/options.go +++ b/plugin/storage/es/options.go @@ -17,7 +17,6 @@ package es import ( "flag" - "math" "strings" "time" @@ -36,7 +35,6 @@ const ( suffixTokenPath = ".token-file" suffixServerURLs = ".server-urls" suffixMaxSpanAge = ".max-span-age" - suffixMaxNumSpans = ".max-num-spans" // deprecated suffixNumShards = ".num-shards" suffixNumReplicas = ".num-replicas" suffixBulkSize = ".bulk.size" @@ -176,12 +174,6 @@ func addFlags(flagSet *flag.FlagSet, nsConfig *namespaceConfig) { nsConfig.namespace+suffixMaxSpanAge, nsConfig.MaxSpanAge, "The maximum lookback for spans in Elasticsearch") - flagSet.Int( - nsConfig.namespace+suffixMaxNumSpans, - nsConfig.MaxDocCount, - "(deprecated, will be removed in release v1.21.0. Please use es.max-doc-count). "+ - "The maximum number of spans to fetch at a time per query in Elasticsearch. "+ - "The lesser of es.max-num-spans and es.max-doc-count will be used if both are set.") flagSet.Int64( nsConfig.namespace+suffixNumShards, nsConfig.NumShards, @@ -292,11 +284,6 @@ func initFromViper(cfg *namespaceConfig, v *viper.Viper) { cfg.MaxDocCount = v.GetInt(cfg.namespace + suffixMaxDocCount) - if v.IsSet(cfg.namespace + suffixMaxNumSpans) { - maxNumSpans := v.GetInt(cfg.namespace + suffixMaxNumSpans) - cfg.MaxDocCount = int(math.Min(float64(maxNumSpans), float64(cfg.MaxDocCount))) - } - // TODO: Need to figure out a better way for do this. cfg.AllowTokenFromContext = v.GetBool(spanstore.StoragePropagationKey) cfg.TLS = cfg.getTLSFlagsConfig().InitFromViper(v) diff --git a/plugin/storage/es/options_test.go b/plugin/storage/es/options_test.go index 65ac35e405a9..c5d6eb73f54a 100644 --- a/plugin/storage/es/options_test.go +++ b/plugin/storage/es/options_test.go @@ -103,11 +103,7 @@ func TestMaxDocCount(t *testing.T) { wantMaxDocCount int }{ {"neither defined", []string{}, 10_000}, - {"max-num-spans only", []string{"--es.max-num-spans=1000"}, 1000}, {"max-doc-count only", []string{"--es.max-doc-count=1000"}, 1000}, - {"max-num-spans == max-doc-count", []string{"--es.max-num-spans=1000", "--es.max-doc-count=1000"}, 1000}, - {"max-num-spans < max-doc-count", []string{"--es.max-num-spans=999", "--es.max-doc-count=1000"}, 999}, - {"max-num-spans > max-doc-count", []string{"--es.max-num-spans=1000", "--es.max-doc-count=999"}, 999}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) {