-
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
[refactor][storage] Remove metrics factory distinctions from storage factories #6526
[refactor][storage] Remove metrics factory distinctions from storage factories #6526
Conversation
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
plugin/storage/factory.go
Outdated
role := "primary" | ||
if _, ok := factory.(storage.ArchiveFactory); ok { | ||
role = "archive" | ||
} |
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 I know this isn't correct but just put it here to start the conversation. This will currently set the role archive
whenever the factory implements the ArchiveFactory. Is there a way to know at this point whether the storage is actually being used as archive
since this is where the metrics factory is passed to the storage factory.
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.
Now that I think more about it, the v1 factory will initialize the CLI flags for both the primary namespace and the archive namespace. Since the factories today hold both the primary and archive configs, we probably need to do one of the following:
- Each storage factory should only hold 1 config - This would be ideal but it would require creating two storage meta-factories which I think we decided we don't want.
- Have the meta-factory pass all the metrics factories in with role=primary but override the role in
CreateArchiveSpanReader
to archive.
Let me know what you think
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.
Went with option 2 for now - if this looks good, we can make the same change for the other storage factories as well
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6526 +/- ##
==========================================
- Coverage 96.27% 96.27% -0.01%
==========================================
Files 372 372
Lines 21283 21278 -5
==========================================
- Hits 20491 20486 -5
Misses 605 605
Partials 187 187
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 <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
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!!!
…factories (jaegertracing#6526) ## Which problem is this PR solving? - Towards jaegertracing#6065 ## Description of the changes - Some of the storage factories were currently adding the `role` tag to the metrics factory that it was getting to differentiate between `primary` and `archive`. Given that goal in v2 is not have that distinction, the adding of the `primary` tag was moved to the v1 meta-factory. This tag can then be overriden by the archive specific methods in the storage factories (mainly `CreateArchiveSpanReader` and `CreateArchiveSpanWriter`) with `role=archive`. ## How was this change tested? - CI ## 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 <mahadzaryab1@gmail.com>
Which problem is this PR solving?
Description of the changes
role
tag to the metrics factory that it was getting to differentiate betweenprimary
andarchive
. Given that goal in v2 is not have that distinction, the adding of theprimary
tag was moved to the v1 meta-factory. This tag can then be overriden by the archive specific methods in the storage factories (mainlyCreateArchiveSpanReader
andCreateArchiveSpanWriter
) withrole=archive
.How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test