diff --git a/plugin/storage/es/options.go b/plugin/storage/es/options.go index 22f92d80806..c98f1134b65 100644 --- a/plugin/storage/es/options.go +++ b/plugin/storage/es/options.go @@ -390,7 +390,7 @@ func initFromViper(cfg *namespaceConfig, v *viper.Viper) { cfg.AdaptiveSamplingLookback = v.GetDuration(cfg.namespace + suffixAdaptiveSamplingLookback) deprecatedNumShards := v.GetInt64(cfg.namespace + suffixNumShards) - deprecatedReplicaShards := v.GetInt64(cfg.namespace + suffixNumShards) + deprecatedReplicaShards := v.GetInt64(cfg.namespace + suffixNumReplicas) cfg.Indices.Spans.TemplateOptions.NumShards = overrideIndexShardsNums(deprecatedNumShards, v.GetInt64(cfg.namespace+suffixNumShardsSpan)) cfg.Indices.Services.TemplateOptions.NumShards = overrideIndexShardsNums(deprecatedNumShards, v.GetInt64(cfg.namespace+suffixNumShardsServices)) diff --git a/plugin/storage/es/options_test.go b/plugin/storage/es/options_test.go index 3f12ed384e0..36ba8f499ce 100644 --- a/plugin/storage/es/options_test.go +++ b/plugin/storage/es/options_test.go @@ -33,8 +33,14 @@ func TestOptions(t *testing.T) { assert.Empty(t, primary.PasswordFilePath) assert.NotEmpty(t, primary.Servers) assert.Empty(t, primary.RemoteReadClusters) - assert.Equal(t, int64(5), primary.NumShards) - assert.Equal(t, int64(1), primary.NumReplicas) + assert.Equal(t, int64(5), primary.Indices.Spans.TemplateOptions.NumShards) + assert.Equal(t, int64(5), primary.Indices.Services.TemplateOptions.NumShards) + assert.Equal(t, int64(5), primary.Indices.Sampling.TemplateOptions.NumShards) + assert.Equal(t, int64(5), primary.Indices.Dependencies.TemplateOptions.NumShards) + assert.Equal(t, int64(1), primary.Indices.Spans.TemplateOptions.NumReplicas) + assert.Equal(t, int64(1), primary.Indices.Services.TemplateOptions.NumReplicas) + assert.Equal(t, int64(1), primary.Indices.Sampling.TemplateOptions.NumReplicas) + assert.Equal(t, int64(1), primary.Indices.Dependencies.TemplateOptions.NumReplicas) assert.Equal(t, 72*time.Hour, primary.MaxSpanAge) assert.False(t, primary.Sniffer) assert.False(t, primary.SnifferTLSEnabled) @@ -104,8 +110,14 @@ func TestOptionsWithFlags(t *testing.T) { assert.Equal(t, []string{"3.3.3.3", "4.4.4.4"}, aux.Servers) assert.Equal(t, "hello", aux.Username) assert.Equal(t, "world", aux.Password) - assert.Equal(t, int64(5), aux.NumShards) - assert.Equal(t, int64(10), aux.NumReplicas) + assert.Equal(t, int64(5), aux.Indices.Spans.TemplateOptions.NumShards) + assert.Equal(t, int64(5), aux.Indices.Services.TemplateOptions.NumShards) + assert.Equal(t, int64(5), aux.Indices.Sampling.TemplateOptions.NumShards) + assert.Equal(t, int64(5), aux.Indices.Dependencies.TemplateOptions.NumShards) + assert.Equal(t, int64(10), aux.Indices.Spans.TemplateOptions.NumReplicas) + assert.Equal(t, int64(10), aux.Indices.Services.TemplateOptions.NumReplicas) + assert.Equal(t, int64(10), aux.Indices.Sampling.TemplateOptions.NumReplicas) + assert.Equal(t, int64(10), aux.Indices.Dependencies.TemplateOptions.NumReplicas) assert.Equal(t, 24*time.Hour, aux.MaxSpanAge) assert.True(t, aux.Sniffer) assert.True(t, aux.Tags.AllAsFields)