Adds minimal traceparent header support to Elasticsearch backport(#74210)#75331
Merged
pgomulka merged 5 commits intoelastic:7.xfrom Aug 3, 2021
Merged
Adds minimal traceparent header support to Elasticsearch backport(#74210)#75331pgomulka merged 5 commits intoelastic:7.xfrom
pgomulka merged 5 commits intoelastic:7.xfrom
Conversation
This adds just enough support for the traceparent header to be useful in es8. Since Elasticsearch already logs in ECS format extending it with support for transaction.id and trace.id is a quick win. This allows us to surface server/deprecation slow logs from an instrumented application using the Trace Logs feature. Parsing `traceparent` in http layer and populating tasks with `trace_id` which is preserved in thread context.
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
pgomulka
commented
Jul 15, 2021
| appender.deprecation_rolling.layout.type = ESJsonLayout | ||
| appender.deprecation_rolling.layout.type_name = deprecation.elasticsearch | ||
| appender.deprecation_rolling.layout.esmessagefields=x-opaque-id | ||
| appender.deprecation_rolling.layout.esmessagefields=x-opaque-id,key |
Contributor
Author
There was a problem hiding this comment.
it was already being set in https://github.com/elastic/elasticsearch/pull/75331/files#diff-585bbd41ac3ed6c6aa4811cecbd0d3e776af7c594e3ae8558fa5434fbfa3bcd6R38
so I thought why not have it in logs too
pugnascotia
reviewed
Jul 21, 2021
| .orElse(""); | ||
| } | ||
|
|
||
| public static String getTraceId() { |
Contributor
There was a problem hiding this comment.
Is this called anywhere? TraceIdConverter has its own implementation.
Contributor
Author
There was a problem hiding this comment.
Good find. I have removed that method.
pugnascotia
approved these changes
Aug 2, 2021
pgomulka
added a commit
to pgomulka/elasticsearch
that referenced
this pull request
Dec 8, 2021
elastic#75331 missed adding trace.id to indexed deprecation logs (they use ECSJsonLayout instead of ESJsonLayout).
pgomulka
added a commit
that referenced
this pull request
Dec 9, 2021
#75331 missed adding trace.id to indexed deprecation logs (these use ECSJsonLayout instead of ESJsonLayout).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds just enough support for the traceparent header to be useful in es7
Contrary to es8 in 7.x branch the logs are in custom JSON format - not in ECS.
trace.id is added to deprecation, slow logs and server JSON logs
backport #74210