Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Elasticsearch OTEL exporter #2140

Merged
merged 3 commits into from
Mar 28, 2020
Merged

Conversation

pavolloffay
Copy link
Member

@pavolloffay pavolloffay commented Mar 25, 2020

Signed-off-by: Pavol Loffay [email protected]

#2139 should go in first and this should reuse storage factory helper.

@pavolloffay pavolloffay requested a review from a team as a code owner March 25, 2020 16:16
@codecov
Copy link

codecov bot commented Mar 25, 2020

Codecov Report

Merging #2140 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2140      +/-   ##
==========================================
- Coverage   96.14%   96.12%   -0.02%     
==========================================
  Files         218      218              
  Lines       10572    10577       +5     
==========================================
+ Hits        10164    10167       +3     
- Misses        352      354       +2     
  Partials       56       56              
Impacted Files Coverage Δ
plugin/storage/cassandra/factory.go 100.00% <100.00%> (ø)
plugin/storage/cassandra/options.go 100.00% <100.00%> (ø)
plugin/storage/es/factory.go 100.00% <100.00%> (ø)
plugin/storage/es/options.go 100.00% <100.00%> (ø)
cmd/query/app/server.go 91.78% <0.00%> (-2.74%) ⬇️
plugin/storage/badger/spanstore/reader.go 96.79% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e06df7...853959c. Read the comment docs.

@objectiser
Copy link
Contributor

@annanay25 Would you be able to review?

Signed-off-by: Pavol Loffay <[email protected]>
Copy link
Member

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than a few nits

func New(config *Config, log *zap.Logger) (exporter.TraceExporter, error) {
factory := es.NewFactory()
factory.InitFromOptions(config.Options)
err := factory.Initialize(metrics.NullFactory, log)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

factory has two init functions, possible to merge?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a difference between them, the first one just initializes the props and the second one creates a connection to the storage.


// DefaultOptions creates Elasticsearch options supported by this exporter.
func DefaultOptions() *es.Options {
return es.NewOptions("es")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a more suitable namespace is "jaeger" / "jaeger-otel" since the es cluster might be used by multiple services

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to be es because we want to be backward compatible with the configuration with jaeger collector. This name is used in flag names e.g. --es.server-urls=

@@ -59,7 +61,7 @@ const (
// to bind them to command line flag and apply overlays, so that some configurations
// (e.g. archive) may be underspecified and infer the rest of its parameters from primary.
type Options struct {
primary *namespaceConfig
Primary namespaceConfig `mapstructure:",squash"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing pointer reference here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapstructure does not work with pointers. It also has to be made public.

plugin/storage/es/options.go Outdated Show resolved Hide resolved
@@ -233,7 +236,7 @@ func initFromViper(cfg *namespaceConfig, v *viper.Viper) {
cfg.Password = v.GetString(cfg.namespace + suffixPassword)
cfg.TokenFilePath = v.GetString(cfg.namespace + suffixTokenPath)
cfg.Sniffer = v.GetBool(cfg.namespace + suffixSniffer)
cfg.servers = stripWhiteSpace(v.GetString(cfg.namespace + suffixServerURLs))
cfg.Servers = strings.Split(stripWhiteSpace(v.GetString(cfg.namespace+suffixServerURLs)), ",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC there's an easier way to do this with viper, using GetStringSlice.

Copy link
Member Author

@pavolloffay pavolloffay Mar 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not make it work with the format of expected values url, url2

Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay merged commit b1868a6 into jaegertracing:master Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants