Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all storages to env command #1541

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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