Skip to content

Commit

Permalink
Add all storages to env command (#1541)
Browse files Browse the repository at this point in the history
* Add all storages to help command

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix comment

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay authored May 16, 2019
1 parent 4c0ff17 commit d51412d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/env/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
Expand Down
5 changes: 3 additions & 2 deletions plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit d51412d

Please sign in to comment.