-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[ES] Make NestedTags
and FieldTags
distinction at CoreSpanWriter
level
#6946
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6946 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 355 355
Lines 20993 21012 +19
=======================================
+ Hits 20156 20175 +19
Misses 630 630
Partials 207 207
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@yurishkuro This is a try to separate tag appending from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the example where snapshot testing would be very helpful, maybe spend a day to build those tests first.
@yurishkuro I am able to generate or reuse the db spans fixtures but I don't have any idea to serialize-deserialize ptrace from json fixtures. Is there anything provided by OTEL? Or we need to use txt fixtures which are used in goldendataset
|
internal/storage/v2/elasticsearch/tracestore/to_dbmodel_test.go
Outdated
Show resolved
Hide resolved
@yurishkuro Please review this PR, after this PR, similar modification will be done in |
internal/storage/v2/elasticsearch/tracestore/to_dbmodel_test.go
Outdated
Show resolved
Hide resolved
internal/storage/v2/elasticsearch/tracestore/to_dbmodel_test.go
Outdated
Show resolved
Hide resolved
@yurishkuro Can you please review this PR as it is a blocker for the next PR (embedding |
internal/storage/v2/elasticsearch/tracestore/to_dbmodel_test.go
Outdated
Show resolved
Hide resolved
internal/storage/v2/elasticsearch/tracestore/fixtures/es_02.json
Outdated
Show resolved
Hide resolved
#6946 (comment) @yurishkuro There is a problem in this approach, if we will firstly convert all the tags to db tag and then materialize them to top-level fields then the value of dbmodel.KeyValue is always put as string (this is what is being done in v1) whereas in tag map it can be anything. For example when 25 is saved in |
in the DB model we have
The Value here is not string, similar to |
@yurishkuro That exactly what even I thought but in v1, every value is string in snapshot tests, also please see this:
Every value which is stored in db tag is string but in tag map, it is like this:
So how should we proceed in v2? As we have to think of backward-compatibilty also as when converting db spans back to OTEL traces, we have to think whether the value is string or any! |
I don't know why v1 converter uses AsString(), I believe I even added a TODO asking about that specifically. But we don't have to blindly replicate v1 converter behavior, I think it should be capturing Value() regardless of where the tag is stored. It's especially important for numeric fields as storing raw value means ES queries can be made against such numeric field, e.g. computing some stats. The only price we'd pay for using Value() is that the reverse translation (db->otlp) will have to be able to deal with the stored value being either a raw value or a string. BTW, using Value() directly is not always correct because if the type is Binary it should be encoded somehow. There may be other limitations of using raw values, e.g. whole numbers in JS are limited to 53bits, so we already have some special handing for those when returning to UI to avoid losing precision. |
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
@yurishkuro Is this PR good to go? |
Signed-off-by: Manik2708 <[email protected]>
@yurishkuro Is this PR good to go now? |
…der` level (#7067) ## Which problem is this PR solving? - Fixes a part of: #7034 ## Description of the changes - Make `NestedTags` and `ElevatedTags` distinction at `CoreSpanReader` level and a follow-up PR for #6946 ## How was this change tested? - Unit And Integration Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <[email protected]>
…racing#6994) ## Which problem is this PR solving? Fixes a part of: jaegertracing#6458 ## Description of the changes - As discussed in jaegertracing#6946 we need to change the value which was saved as string in v1 to a raw value in v2 ## How was this change tested? - Unit Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` Signed-off-by: Manik2708 <[email protected]>
…` level (jaegertracing#6946) ## Which problem is this PR solving? - Fixes a part of: jaegertracing#6458 ## Description of the changes - `TagDotReplacement` which is responsible for nested and field tags distinction was earlier at writer level (of model and OTLP) which doesn't make sense as DB layer should manipulate whatever is optimal for the database, therfore now it is a part of `CoreSpanWriter` ## How was this change tested? - Unit Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <[email protected]>
…der` level (jaegertracing#7067) ## Which problem is this PR solving? - Fixes a part of: jaegertracing#7034 ## Description of the changes - Make `NestedTags` and `ElevatedTags` distinction at `CoreSpanReader` level and a follow-up PR for jaegertracing#6946 ## How was this change tested? - Unit And Integration Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <[email protected]>
…racing#6994) ## Which problem is this PR solving? Fixes a part of: jaegertracing#6458 ## Description of the changes - As discussed in jaegertracing#6946 we need to change the value which was saved as string in v1 to a raw value in v2 ## How was this change tested? - Unit Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` Signed-off-by: Manik2708 <[email protected]> Signed-off-by: amol-verma-allen <[email protected]>
…` level (jaegertracing#6946) ## Which problem is this PR solving? - Fixes a part of: jaegertracing#6458 ## Description of the changes - `TagDotReplacement` which is responsible for nested and field tags distinction was earlier at writer level (of model and OTLP) which doesn't make sense as DB layer should manipulate whatever is optimal for the database, therfore now it is a part of `CoreSpanWriter` ## How was this change tested? - Unit Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <[email protected]> Signed-off-by: amol-verma-allen <[email protected]>
…der` level (jaegertracing#7067) ## Which problem is this PR solving? - Fixes a part of: jaegertracing#7034 ## Description of the changes - Make `NestedTags` and `ElevatedTags` distinction at `CoreSpanReader` level and a follow-up PR for jaegertracing#6946 ## How was this change tested? - Unit And Integration Tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] 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`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <[email protected]> Signed-off-by: amol-verma-allen <[email protected]>
Which problem is this PR solving?
Description of the changes
TagDotReplacement
which is responsible for nested and field tags distinction was earlier at writer level (of model and OTLP) which doesn't make sense as DB layer should manipulate whatever is optimal for the database, therfore now it is a part ofCoreSpanWriter
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test