diff --git a/plugin/storage/es/options.go b/plugin/storage/es/options.go index 06da56a3d8f..c575befc8a4 100644 --- a/plugin/storage/es/options.go +++ b/plugin/storage/es/options.go @@ -179,9 +179,9 @@ func addFlags(flagSet *flag.FlagSet, nsConfig *namespaceConfig) { flagSet.Int( nsConfig.namespace+suffixMaxNumSpans, nsConfig.MaxDocCount, - "(deprecated, will be removed in release v1.21.0. Please use es.max-doc-count). "+ + "(deprecated, will be removed in release v1.21.0. Please use "+nsConfig.namespace+".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.") + "The lesser of "+nsConfig.namespace+".max-num-spans and "+nsConfig.namespace+".max-doc-count will be used if both are set.") flagSet.Int64( nsConfig.namespace+suffixNumShards, nsConfig.NumShards, diff --git a/plugin/storage/es/options_test.go b/plugin/storage/es/options_test.go index 65ac35e405a..a7148a82e68 100644 --- a/plugin/storage/es/options_test.go +++ b/plugin/storage/es/options_test.go @@ -96,6 +96,33 @@ func TestOptionsWithFlags(t *testing.T) { assert.Equal(t, "test,tags", aux.Tags.Include) } +func TestMaxNumSpansUsage(t *testing.T) { + testCases := []struct { + namespace string + wantUsage string + }{ + { + namespace: "es", + wantUsage: "(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.", + }, + { + namespace: "es-archive", + wantUsage: "(deprecated, will be removed in release v1.21.0. Please use es-archive.max-doc-count). " + + "The maximum number of spans to fetch at a time per query in Elasticsearch. " + + "The lesser of es-archive.max-num-spans and es-archive.max-doc-count will be used if both are set.", + }, + } + for _, tc := range testCases { + t.Run(tc.namespace, func(t *testing.T) { + opts := NewOptions(tc.namespace) + _, command := config.Viperize(opts.AddFlags) + assert.Equal(t, tc.wantUsage, command.Flag(tc.namespace+".max-num-spans").Usage) + }) + } +} + func TestMaxDocCount(t *testing.T) { testCases := []struct { name string