From 94bf32fdb71c4bdd03cbb100e6288ff1e0af134f Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Thu, 16 May 2019 10:38:04 +0200 Subject: [PATCH 1/2] Add all storages to help command Signed-off-by: Pavol Loffay --- cmd/env/command.go | 2 +- plugin/storage/factory.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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..552325183a6 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -50,7 +50,7 @@ const ( defaultDownsamplingHashSalt = "" ) -var allStorageTypes = []string{cassandraStorageType, elasticsearchStorageType, memoryStorageType, kafkaStorageType, badgerStorageType, grpcPluginStorageType} +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 +95,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) } } From 32883bf8ab9ef6974e5cb649374e5e16d732a4a8 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Thu, 16 May 2019 10:41:18 +0200 Subject: [PATCH 2/2] Fix comment Signed-off-by: Pavol Loffay --- plugin/storage/factory.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 552325183a6..394efc8e303 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -50,6 +50,7 @@ const ( defaultDownsamplingHashSalt = "" ) +// 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.