-
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
[es] Add index rollover mode that can choose day and hour #2965
[es] Add index rollover mode that can choose day and hour #2965
Conversation
Signed-off-by: WalkerWang731 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2965 +/- ##
==========================================
+ Coverage 95.95% 95.97% +0.02%
==========================================
Files 224 224
Lines 9747 9773 +26
==========================================
+ Hits 9353 9380 +27
+ Misses 325 324 -1
Partials 69 69
Continue to review full report at Codecov.
|
Hi @albertteoh |
@@ -199,9 +200,16 @@ func timeRangeIndices(indexName, indexDateLayout string, startTime time.Time, en | |||
var indices []string | |||
firstIndex := indexWithDate(indexName, indexDateLayout, startTime) | |||
currentIndex := indexWithDate(indexName, indexDateLayout, endTime) | |||
|
|||
reduce := -24 * time.Hour | |||
if strings.HasSuffix(indexDateLayout, "15") { |
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.
It's a shame time.stdHour
isn't exported.
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.
A cleaner way is to pass freq directly as parameter, not infer it back from format string
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.
Yeah, I also thought previously, but if pass freq directly then will also judge this variable too(if freq == "day"
or move this judgment to ClientBuilder
of config.go
), basically it same as currently.
And another side, other functions will be become more complicated include NewSpanReader
SpanReaderParams
SpanReader
addRemoteReadClusters
timeRangeIndices
createSpanWriter
and reader relevant factory functions and all of unit test functions. and change the ClientBuilder
of config.go
.
Actually, I always thought this commit should be small and should not change more code, but if we need, I can do 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.
fair enough. As Albert said, it would be good to at least use a named constant shared between config and span reader
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, I see, now that we decide to add the new constant, I want to separate rollover jaeger-span
and jaeger-service
incidentally. How about?
Because the reason can refer here
I will add two params index-rollover-span-frequency
and index-rollover-span-frequency
, do you have any suggestions?
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.
Sounds good. I would suggest these names index-rollover-frequency-spans
and index-rollover-frequency-services
plugin/storage/es/options.go
Outdated
nsConfig.namespace+suffixIndexRolloverFrequency, | ||
defaultIndexRolloverFrequency, | ||
"Rotates Jaeger indices over the given period. For example \"day\" creates \"jaeger-span-yyyy-MM-dd\" every day after UTC 12AM. Valid options: [hour, day]. "+ | ||
"Jaeger additionally supports manual and automated (via ILM) index management. Reference: https://www.jaegertracing.io/docs/deployment/#elasticsearch-rollover.") |
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.
Didn't we decide to change this msg?
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.
@WalkerWang731 I believe we suggested to reword this to (@yurishkuro please correct if I'm wrong):
This does not delete old indices. For details on complete index management solutions supported by Jaeger, refer to: https://www.jaegertracing.io/docs/deployment/#elasticsearch-rollover
Signed-off-by: WalkerWang731 <[email protected]>
…hub.com:WalkerWang731/jaeger into walkerwang731/add_index_rollover_for_es_storage Signed-off-by: WalkerWang731 <[email protected]>
Pull request has been modified.
…defaultIndexRolloverFrequency Signed-off-by: WalkerWang731 <[email protected]>
Hi @yurishkuro @albertteoh, |
Signed-off-by: WalkerWang731 <[email protected]>
Signed-off-by: albertteoh <[email protected]>
Signed-off-by: Albert Teoh <[email protected]>
…hub.com:WalkerWang731/jaeger into walkerwang731/add_index_rollover_for_es_storage
Signed-off-by: yourgithubname <[email protected]>
Thanks @WalkerWang731! |
Which problem is this PR solving?
Short description of the changes
index-rollover-frequency-spans
andindex-rollover-frequency-services
, default is day mode, will not affect existing usageParameter config of
collector
ingester
query
(SPAN_STORAGE_TYPE=elasticsearch)