-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Jaeger-V2] Add configurable index data layout and rollover frequency #5790
base: main
Are you sure you want to change the base?
[Jaeger-V2] Add configurable index data layout and rollover frequency #5790
Conversation
5e66765
to
f77bc5b
Compare
0c67510
to
d203d55
Compare
01544c8
to
05d35bc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5790 +/- ##
==========================================
- Coverage 96.82% 96.81% -0.01%
==========================================
Files 345 345
Lines 16518 16570 +52
==========================================
+ Hits 15993 16043 +50
- Misses 339 340 +1
- Partials 186 187 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks pretty good, thanks for doing this.
e89accf
to
422a678
Compare
9f49a23
to
8d42129
Compare
ad01a13
to
8d3ebb6
Compare
a33a5ac
to
25d332c
Compare
Did you do a manual One brute force way to fix it is to (a) zip all the files in a repo, (b) recreate the branch off main head, (c) unzip the files back, |
3f164a4
to
f2e1416
Compare
yes, I did |
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
f2e1416
to
47c0a63
Compare
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
OS/ES tests specifically are failing, most likely related to your changes. |
for instance
|
ok,i will check it soon |
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
2f587d5
to
037f479
Compare
ES v7 failed with
|
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
rollover tests fail - it looks like somewhere the prefix is not being respected. |
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
…ithub.com/JaredTan95/jaeger into configure-index-daltalayout-and-frequency
Signed-off-by: Yuri Shkuro <github@ysh.us>
another_storage: | ||
elasticsearch: | ||
index_prefix: "jaeger-archive" | ||
indices: | ||
spans: |
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.
Q: is the services index being built at all when the storage is in the archive mode? I don't think it should be, but in this configuration services.prefix: "jaeger-main"
would be the default, and the archive storage is not told in any way that it is indeed archive.
IndexPrefix: cfg.IndexPrefix, | ||
IndexDateLayout: cfg.IndexDateLayoutDependencies, | ||
IndexPrefix: cfg.Indices.Dependencies.Prefix, | ||
IndexDateLayout: cfg.Indices.Dependencies.RolloverFrequency, |
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.
looks like a bug: RolloverFrequency -> DateLayout. Please re-check everywhere.
type IndexTemplateOptions struct { | ||
UseILM bool | ||
ILMPolicyName string | ||
config.IndexOptions |
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.
nit: I would recommend against embedding the whole struct, because it makes the templates tightly coupled with the configuration. E.g. it looks like only a couple of fields are actually used in the templates, prefix and priority, so I would define them explicitly in IndexTemplateOptions and copy from IndexOptions as needed. This way we won't have to change the templates just because we changed the config struct.
@@ -20,10 +20,35 @@ extensions: | |||
backends: | |||
some_storage: | |||
elasticsearch: | |||
index_prefix: "jaeger-main" |
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.
TODO: we may want to rethink if we still want a single field in the config for index prefix, which would apply if the individual index options didn't override it explicitly. This would simplify the configuration while maintaining the flexibility.
if prefix != "" { | ||
return prefix + indexPrefixSeparator + index |
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.
looking at mapping.go I think this should be a bit smarter, e.g.
if prefix != "" { | |
return prefix + indexPrefixSeparator + index | |
if prefix != "" { | |
if !prefix.endsWith(indexPrefixSeparator) { prefix += indexPrefixSeparator } | |
return prefix + index |
if prefix != "" { | ||
prefix += indexPrefixSeparator | ||
func getSpanAndServiceIndexFn(archive, useReadWriteAliases bool, spanIndexOpts, serviceIndexOpts cfg.IndexOptions) spanAndServiceIndexFn { | ||
if spanIndexOpts.Prefix != "" { |
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.
similar to above
if spanIndexOpts.Prefix != "" { | |
if spanIndexOpts.Prefix != "" && !strings.HasSuffix(spanIndexOpts.Prefix, indexPrefixSeparator) { |
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.
since we do this in multiple places I would extract into a single function. Ideally these kinds of adjustments should be done very early after parsing the config, not spread out across many places in the code. It could be even a helper function on the IndexOptions struct, e.g.
func (o IndexOptions) FullIndexName(name string) {
if o.Prefix == "" {
return name
}
if strings.HasSuffix(o.Prefix. indexPrefixSeparator) {
return o.Prefix + name
}
return o.Prefix + indexPrefixSeparator + name
}
make configure index datalayout and frequency in
jaeger-v2
I think this way is a bit repetitive, as I am trying to contribute for the first time, there are better ways to achieve please guide~