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

Return more detailed errors from ES storage #5209

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

  • In many cases when ES operations fail, the only error returned to the UI or written to Jaeger log is all shards fail, which is pretty useless for the actual troubleshooting.
  • Meanwhile, the driver actually returns an error struct that contains a RootCause field.

Description of the changes

  • Inspect the error and include root cause if present

How was this change tested?

Run all-in-one and curl 'http://localhost:16686/api/services'

Before:
$ curl 'http://localhost:16686/api/services'
{"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]"}]}

After:
$ curl 'http://localhost:16686/api/services'
{"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]: RootCause[Fielddata is disabled on [serviceName] in [jaeger-service-]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [serviceName] in order to load field data by uninverting the inverted index. Note that this can use significant memory. [type=illegal_argument_exception]]"}]}

Signed-off-by: Yuri Shkuro <github@ysh.us>
Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5375e1e) 94.44% compared to head (864eb70) 94.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5209      +/-   ##
==========================================
- Coverage   94.44%   94.43%   -0.02%     
==========================================
  Files         332      333       +1     
  Lines       19189    19201      +12     
==========================================
+ Hits        18124    18133       +9     
- Misses        878      880       +2     
- Partials      187      188       +1     
Flag Coverage Δ
cassandra-3.x 25.53% <0.00%> (-0.05%) ⬇️
cassandra-4.x 25.53% <0.00%> (-0.05%) ⬇️
elasticsearch-5.x 19.83% <0.00%> (-0.04%) ⬇️
elasticsearch-6.x 19.83% <0.00%> (-0.04%) ⬇️
elasticsearch-7.x 19.94% <0.00%> (-0.06%) ⬇️
elasticsearch-8.x 20.03% <0.00%> (-0.06%) ⬇️
grpc-badger 19.46% <0.00%> (-0.03%) ⬇️
kafka 14.06% <0.00%> (-0.03%) ⬇️
opensearch-1.x 19.96% <0.00%> (-0.04%) ⬇️
opensearch-2.x 19.94% <0.00%> (-0.04%) ⬇️
unittests 92.28% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yuri Shkuro <github@ysh.us>
Copy link
Contributor

@jkowall jkowall left a comment

Choose a reason for hiding this comment

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

LGTM!

@yurishkuro yurishkuro merged commit cdb8b3f into jaegertracing:main Feb 19, 2024
34 of 35 checks passed
@yurishkuro yurishkuro deleted the es-errors branch February 19, 2024 02:26
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.

None yet

2 participants