Skip to content

Commit

Permalink
[jaeger-v2] Add support for Opensearch (#5257)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- part of #4843

## Description of the changes
- Added OpenSearch support in jaeger-V2.
- Reused the existing Elasticsearch factory for OpenSearch.

## How was this change tested?
- tested locally by running jaeger-v2 with newly added opensearch
config-file.
- Run the opensearch container:
```bash
docker run --rm --name opensearch -p 9200:9200 -e "discovery.type=single-node" opensearchproject/opensearch:1.3.0
```
- Execute below to run jaeger-V2
```bash
go run -tags=ui ./cmd/jaeger/. --config ./cmd/jaeger/config-opensearch.yaml
```

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <122517264+akagami-harsh@users.noreply.github.com>
  • Loading branch information
akagami-harsh committed Mar 21, 2024
1 parent 29e3fe8 commit db8c04c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
54 changes: 54 additions & 0 deletions cmd/jaeger/config-opensearch.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions cmd/jaeger/internal/extension/jaegerstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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"`
Cassandra map[string]cassandraCfg.Configuration `mapstructure:"cassandra"`
// TODO add other storage types here
Expand Down
7 changes: 7 additions & 0 deletions cmd/jaeger/internal/extension/jaegerstorage/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ 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,
}
cassandraStarter := &starter[cassandraCfg.Configuration, *cassandra.Factory]{
ext: s,
storageKind: "cassandra",
Expand All @@ -142,6 +148,7 @@ func (s *storageExt) Start(ctx context.Context, host component.Host) error {
badgerStarter.build,
grpcStarter.build,
esStarter.build,
osStarter.build,
cassandraStarter.build,
// TODO add support for other backends
}
Expand Down

0 comments on commit db8c04c

Please sign in to comment.