From 153edefa1f1c0a0d1cb1d440b0ea381e5d8951d6 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Thu, 7 Mar 2024 21:04:04 +0530 Subject: [PATCH 1/3] add support for opensearch Signed-off-by: Harshvir Potpose --- cmd/jaeger/config-opensearch.yaml | 54 +++++++++++++++++++ .../extension/jaegerstorage/config.go | 1 + .../extension/jaegerstorage/extension.go | 7 +++ 3 files changed, 62 insertions(+) create mode 100644 cmd/jaeger/config-opensearch.yaml diff --git a/cmd/jaeger/config-opensearch.yaml b/cmd/jaeger/config-opensearch.yaml new file mode 100644 index 00000000000..7debd780ee6 --- /dev/null +++ b/cmd/jaeger/config-opensearch.yaml @@ -0,0 +1,54 @@ +service: + extensions: [jaeger_storage, jaeger_query] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [jaeger_storage_exporter] + +extensions: + jaeger_query: + trace_storage: os_main + trace_storage_archive: os_archive + ui_config: ./cmd/jaeger/config-ui.json + + jaeger_storage: + opensearch: + os_main: + server_urls: https://localhost:9200 + log_level: "error" + index_prefix: "jaeger-main" + use_aliases: true + username: "admin" + password: "admin" + tls: + enabled: true + skip_host_verify: true + tags_as_fields: + all: true + + os_archive: + server_urls: https://localhost:9200 + log_level: "error" + index_prefix: "jaeger-archive" + use_aliases: true + username: "admin" + password: "admin" + tls: + enabled: true + skip_host_verify: true + tags_as_fields: + all: true + +receivers: + otlp: + protocols: + grpc: + http: + +processors: + batch: + +exporters: + jaeger_storage_exporter: + trace_storage: os_main diff --git a/cmd/jaeger/internal/extension/jaegerstorage/config.go b/cmd/jaeger/internal/extension/jaegerstorage/config.go index 87464ef9311..38b2533edc5 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/config.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/config.go @@ -18,6 +18,7 @@ type Config struct { Memory map[string]memoryCfg.Configuration `mapstructure:"memory"` Badger map[string]badgerCfg.NamespaceConfig `mapstructure:"badger"` GRPC map[string]grpcCfg.Configuration `mapstructure:"grpc"` + Opensearch map[string]esCfg.Configuration `mapstructure:"opensearch"` Elasticsearch map[string]esCfg.Configuration `mapstructure:"elasticsearch"` // TODO add other storage types here // TODO how will this work with 3rd party storage implementations? diff --git a/cmd/jaeger/internal/extension/jaegerstorage/extension.go b/cmd/jaeger/internal/extension/jaegerstorage/extension.go index 70275674e33..cd70cb15d9a 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/extension.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/extension.go @@ -128,12 +128,19 @@ func (s *storageExt) Start(ctx context.Context, host component.Host) error { cfg: s.config.Elasticsearch, builder: es.NewFactoryWithConfig, } + osStarter := &starter[esCfg.Configuration, *es.Factory]{ + ext: s, + storageKind: "opensearch", + cfg: s.config.Opensearch, + builder: es.NewFactoryWithConfig, + } builders := []func(ctx context.Context, host component.Host) error{ memStarter.build, badgerStarter.build, grpcStarter.build, esStarter.build, + osStarter.build, // TODO add support for other backends } for _, builder := range builders { From 80fc2ff13d332f168c94ce93197035c6666cb06d Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Wed, 20 Mar 2024 13:14:17 +0530 Subject: [PATCH 2/3] fix lint Signed-off-by: Harshvir Potpose --- cmd/jaeger/internal/extension/jaegerstorage/config.go | 10 +++++----- .../internal/extension/jaegerstorage/extension.go | 2 +- jaeger-ui | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/jaeger/internal/extension/jaegerstorage/config.go b/cmd/jaeger/internal/extension/jaegerstorage/config.go index 60d94607a81..10afd448c9e 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/config.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/config.go @@ -16,11 +16,11 @@ import ( // Config has the configuration for jaeger-query, type Config struct { - Memory map[string]memoryCfg.Configuration `mapstructure:"memory"` - Badger map[string]badgerCfg.NamespaceConfig `mapstructure:"badger"` - GRPC map[string]grpcCfg.Configuration `mapstructure:"grpc"` - Opensearch map[string]esCfg.Configuration `mapstructure:"opensearch"` - Elasticsearch map[string]esCfg.Configuration `mapstructure:"elasticsearch"` + Memory map[string]memoryCfg.Configuration `mapstructure:"memory"` + Badger map[string]badgerCfg.NamespaceConfig `mapstructure:"badger"` + GRPC map[string]grpcCfg.Configuration `mapstructure:"grpc"` + Opensearch map[string]esCfg.Configuration `mapstructure:"opensearch"` + Elasticsearch map[string]esCfg.Configuration `mapstructure:"elasticsearch"` Cassandra map[string]cassandraCfg.Configuration `mapstructure:"cassandra"` // TODO add other storage types here // TODO how will this work with 3rd party storage implementations? diff --git a/cmd/jaeger/internal/extension/jaegerstorage/extension.go b/cmd/jaeger/internal/extension/jaegerstorage/extension.go index 7143ea31bed..f718ca8cef0 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/extension.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/extension.go @@ -135,7 +135,7 @@ func (s *storageExt) Start(ctx context.Context, host component.Host) error { storageKind: "opensearch", cfg: s.config.Opensearch, builder: es.NewFactoryWithConfig, - } + } cassandraStarter := &starter[cassandraCfg.Configuration, *cassandra.Factory]{ ext: s, storageKind: "cassandra", diff --git a/jaeger-ui b/jaeger-ui index f704b56fbc8..f5cd649b095 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit f704b56fbc8dedf3b7f1e23884db8108157598db +Subproject commit f5cd649b0954704a8ced8b13b71da02a31952260 From b822adfb5ade72be1a5eb89b20c62b96d45fed95 Mon Sep 17 00:00:00 2001 From: Harshvir Potpose Date: Wed, 20 Mar 2024 13:18:36 +0530 Subject: [PATCH 3/3] fix Signed-off-by: Harshvir Potpose --- jaeger-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaeger-ui b/jaeger-ui index f5cd649b095..f704b56fbc8 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit f5cd649b0954704a8ced8b13b71da02a31952260 +Subproject commit f704b56fbc8dedf3b7f1e23884db8108157598db