diff --git a/cmd/env/command.go b/cmd/env/command.go index 14f0f4211ec..3a499b4c3d0 100644 --- a/cmd/env/command.go +++ b/cmd/env/command.go @@ -42,7 +42,7 @@ their names to upper case and replacing punctuation with underscores. For exampl The following configuration options are only available via environment variables:`+"\n") fs := new(pflag.FlagSet) - fs.String(storage.SpanStorageTypeEnvVar, "cassandra", `The type of backend (cassandra, elasticsearch, kafka, memory) used for trace storage. Multiple backends can be specified (currently only for writing spans) as comma-separated list, e.g. "cassandra,kafka".`) + fs.String(storage.SpanStorageTypeEnvVar, "cassandra", fmt.Sprintf("The type of backend %s used for trace storage. Multiple backends can be specified (currently only for writing spans) as comma-separated list, e.g. \"cassandra,kafka\".", storage.AllStorageTypes)) fs.String(storage.DependencyStorageTypeEnvVar, "${SPAN_STORAGE}", "The type of backend used for service dependencies storage.") fmt.Fprintln(cmd.OutOrStdout(), strings.Replace(fs.FlagUsagesWrapped(1000), " --", " ", -1)) }, diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 44812af864c..394efc8e303 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -50,7 +50,8 @@ const ( defaultDownsamplingHashSalt = "" ) -var allStorageTypes = []string{cassandraStorageType, elasticsearchStorageType, memoryStorageType, kafkaStorageType, badgerStorageType, grpcPluginStorageType} +// AllStorageTypes defines all available storage backends +var AllStorageTypes = []string{cassandraStorageType, elasticsearchStorageType, memoryStorageType, kafkaStorageType, badgerStorageType, grpcPluginStorageType} // Factory implements storage.Factory interface as a meta-factory for storage components. type Factory struct { @@ -95,7 +96,7 @@ func (f *Factory) getFactoryOfType(factoryType string) (storage.Factory, error) case grpcPluginStorageType: return grpc.NewFactory(), nil default: - return nil, fmt.Errorf("unknown storage type %s. Valid types are %v", factoryType, allStorageTypes) + return nil, fmt.Errorf("unknown storage type %s. Valid types are %v", factoryType, AllStorageTypes) } }