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

Fix Elasticsearch version in ES OTEL writer #2409

Merged
merged 2 commits into from
Aug 24, 2020

Conversation

pavolloffay
Copy link
Member

Signed-off-by: Pavol Loffay ploffay@redhat.com

Resolves #2407

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
if err != nil {
return nil, err
}
logger.Info("Elasticsearch detected", zap.Int("version", esVersion))
params.Version = uint(esVersion)
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 ES version is derived here in the client factory method and assigned to the config. However the config is passed by value, hence the changes are not reflected after this function. Then the wrong value of the version was used by the called to create index template.

Instead of overriding the config it is cleaner to expose the version on the client.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

LGTM, although lint failed. I'll approve if you can fix that.

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@codecov
Copy link

codecov bot commented Aug 24, 2020

Codecov Report

Merging #2409 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2409      +/-   ##
==========================================
- Coverage   95.56%   95.54%   -0.03%     
==========================================
  Files         208      208              
  Lines       10676    10676              
==========================================
- Hits        10203    10200       -3     
- Misses        401      403       +2     
- Partials       72       73       +1     
Impacted Files Coverage Δ
cmd/query/app/server.go 91.11% <0.00%> (-2.23%) ⬇️
plugin/storage/integration/integration.go 80.38% <0.00%> (-0.48%) ⬇️

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 09fde54...deccc76. Read the comment docs.

esPing := elasticsearchPing{
username: params.Username,
password: params.Password,
roundTripper: roundTripper,
}
esVersion, err := esPing.getVersion(params.Servers[0])
esVersion, err = esPing.getVersion(params.Servers[0])
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to check length of .Servers before dereferencing? It does appear that right now it's impossible to pass Servers with length 0 into this method, but the code that prevents that is fairly distant from this.

Might be better if this method protects itself.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 I am will submit a follow-up PR to fix that

Copy link
Member Author

Choose a reason for hiding this comment

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

@pavolloffay pavolloffay merged commit e7f5227 into jaegertracing:master Aug 24, 2020
@apptut
Copy link

apptut commented Aug 14, 2023

I have defined the --es.version=7, but in es v7.15.2 already not working.

HTTP Error: search services failed: elastic: Error 400 (Bad Request): all shards failed [type=search_phase_execution_exception]

{
  "data": null,
  "total": 0,
  "limit": 0,
  "offset": 0,
  "errors": [
    {
      "code": 500,
      "msg": "search services failed: elastic: Error 400 (Bad Request): all shards failed [type=search_phase_execution_exception]"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does Jaeger OpenTelemetry support Elasticsearch 7?
4 participants