From 1c1e0e319bf88d1d460623789aac60c708690af9 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 9 Sep 2021 11:54:54 -0400 Subject: [PATCH] Add `opensearch` as storage option Signed-off-by: Yuri Shkuro --- plugin/storage/factory.go | 12 +++++++----- plugin/storage/factory_config.go | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 8d00e409059..5a6f2261638 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -39,14 +39,16 @@ import ( const ( cassandraStorageType = "cassandra" + opensearchStorageType = "opensearch" elasticsearchStorageType = "elasticsearch" memoryStorageType = "memory" kafkaStorageType = "kafka" grpcPluginStorageType = "grpc-plugin" badgerStorageType = "badger" - downsamplingRatio = "downsampling.ratio" - downsamplingHashSalt = "downsampling.hashsalt" - spanStorageType = "span-storage-type" + + downsamplingRatio = "downsampling.ratio" + downsamplingHashSalt = "downsampling.hashsalt" + spanStorageType = "span-storage-type" // defaultDownsamplingRatio is the default downsampling ratio. defaultDownsamplingRatio = 1.0 @@ -55,7 +57,7 @@ const ( ) // AllStorageTypes defines all available storage backends -var AllStorageTypes = []string{cassandraStorageType, elasticsearchStorageType, memoryStorageType, kafkaStorageType, badgerStorageType, grpcPluginStorageType} +var AllStorageTypes = []string{cassandraStorageType, opensearchStorageType, elasticsearchStorageType, memoryStorageType, kafkaStorageType, badgerStorageType, grpcPluginStorageType} // Factory implements storage.Factory interface as a meta-factory for storage components. type Factory struct { @@ -90,7 +92,7 @@ func (f *Factory) getFactoryOfType(factoryType string) (storage.Factory, error) switch factoryType { case cassandraStorageType: return cassandra.NewFactory(), nil - case elasticsearchStorageType: + case elasticsearchStorageType, opensearchStorageType: return es.NewFactory(), nil case memoryStorageType: return memory.NewFactory(), nil diff --git a/plugin/storage/factory_config.go b/plugin/storage/factory_config.go index 72ad9558de7..8432f129c41 100644 --- a/plugin/storage/factory_config.go +++ b/plugin/storage/factory_config.go @@ -44,6 +44,7 @@ type FactoryConfig struct { // FactoryConfigFromEnvAndCLI reads the desired types of storage backends from SPAN_STORAGE_TYPE and // DEPENDENCY_STORAGE_TYPE environment variables. Allowed values: // * `cassandra` - built-in +// * `opensearch` - built-in // * `elasticsearch` - built-in // * `memory` - built-in // * `kafka` - built-in