-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[v2][query] Create archive reader/writer using regular factory methods #6519
Conversation
Signed-off-by: Mahad Zaryab <[email protected]>
@yurishkuro should this be marked as a breaking change? the es storage wont use the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6519 +/- ##
==========================================
- Coverage 96.23% 96.21% -0.02%
==========================================
Files 373 373
Lines 21378 21400 +22
==========================================
+ Hits 20574 20591 +17
- Misses 612 616 +4
- Partials 192 193 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Mahad Zaryab <[email protected]>
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.
There is a breaking change implied here, in the sense that if the users do not set the config options appropriately the new storage objects may not behave the same way as archive objects did previously. I recommend handling it with a feature gate from OTEL. We can declare the feature with Beta state (i.e. enabled right away, mark as breaking change), but the users have the option to turn it off manually and fall back onto the old behavior that we should preserve for now. Then in the next release we set the feature to Stable where turning it off will give a runtime error (could also be labeled a breaking change) so the new behavior is the only one possible. And then in the following release we remove the feature altogether along with the legacy code.
example in cmd/jaeger/internal/extension/remotesampling/config.go
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.
lgtm
I have a feeling we will still need to address the question of removing create-archive methods later because as we start LFX project and being implementing v2 API in the storage directly, we will run into issue with Elasticsearch implementation. |
I think this is breaking backwards compatibility, is it not? I.e. to get the equivalent behavior as the previous version the user needs to set some parameters (which ones, what combination?) |
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
…6555) ## Which problem is this PR solving? - Towards #6065 ## Description of the changes - This PR implements a reverse adapter (SpanWriter) that wraps a native v2 storage writer (tracestore.Writer) and downgrades it to implement the v1 writer (spanstore.Writer). - This will be used by #6519 to downgrade a native v2 writer so that it can be used by the v1 query service ## How was this change tested? - Added 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: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
@@ -140,26 +142,58 @@ func (s *server) addArchiveStorage( | |||
return nil | |||
} | |||
|
|||
f, err := jaegerstorage.GetStorageFactory(s.config.Storage.TracesArchive, host) |
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.
Do we still need this method anywhere? If yes, can that code be upgraded as well? If no, I would remove it.
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.
@yurishkuro its still used in the following places and cannot be upgraded in this PR because they rely on interfaces to be implemented natively
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.
Ok let's book child tickets to address that
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.
please move the test report into the description, so that it's more discoverable
Signed-off-by: Mahad Zaryab <[email protected]>
Which problem is this PR solving?
Description of the changes
CreateArchiveSpanReader
andCreateArchiveSpanWriter
and replace them with their primary storage counterparts from the v2 storage APICreateTraceReader
andCreateTraceWriter
.traces_archive
🛑Test Report
1. Establish Ground Truth on
main
To begin, configure the storage and query settings in the
all-in-one.yaml
file as follows:2. Spin Up Elasticsearch Using Docker
To bring up Elasticsearch, run the following commands:
jaeger % cd docker-compose/elasticsearch/v8 v8 % docker compose up
3. Start Jaeger
Start the Jaeger service:
4. Archive a Trace
From the Jaeger UI, select a trace and archive it.
traceID:
0dc3e460bd9b8e0dddfa29a2f751cfb9
5. Update
index_prefix
Stop Jaeger and modify the
index_prefix
in the primary configuration tojaeger-main-1
. This ensures the query for the same trace is no longer found in the primary storage but will be found in the archive storage.6. Query for the Same Trace
7. Test Changes from This PR
Stop Jaeger, checkout this PR, and restart Jaeger:
8. Query for the Same Trace After PR Changes
🛑 This is where the breaking change occurs 🛑
9. Mitigation for Users
Set
use_aliases
for Archive StorageTo mitigate the issue, set the
use_aliases
configuration for your archive storage totrue
. Update the configuration as follows:Add Alias from Old Index to New Index
To ensure backwards compatibility, add an alias from the old index to the new index. You can query the current set of aliases in Elasticsearch with:
curl -X GET "http://localhost:9200/_aliases?pretty"
To link the new index (
jaeger-archive-jaeger-span-read
) with the old index (jaeger-archive-jaeger-span-archive
), run the following:Confirm that the alias has been added:
curl -X GET "http://localhost:9200/_aliases?pretty"
Note that if you already had
use_aliases
set to true for your archive storage before the upgrade, then Jaeger would've been using an index name with -read suffix:jaeger-archive-jaeger-span-archive-read
. Then for the example above, you would create an aliasjaeger-archive-jaeger-span-read
pointing tojaeger-archive-jaeger-span-archive-read
.10. Restart Jaeger and Retry the Query
Finally, restart Jaeger and run the same trace queries again:
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test