Skip to content

Commit

Permalink
Add opensearch as storage option
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Sep 9, 2021
1 parent b5d340d commit 1c1e0e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions plugin/storage/factory_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c1e0e3

Please sign in to comment.