-
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] Seperated the parts of ES-Rollover Config common with ES Config #6516
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,34 @@ type BearerTokenAuthentication struct { | |
AllowFromContext bool `mapstructure:"from_context"` | ||
} | ||
|
||
// RolloverOptions store the options for the working of auto-rollover (cron job) in the jaeger. | ||
type RolloverOptions struct { | ||
Manik2708 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Archive if set to true will handle archive indices also | ||
Archive bool `mapstructure:"archive"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we're working on removing the explicit knowledge of "archive" from storage implementations. Is this needed? cc @mahadzaryab1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we're very close to cleaning up archive, so I'd like to hold this PR until we merge #6490 and then do archive differently. |
||
// The name of the ILM policy to use if ILM is active | ||
ILMPolicyName string `mapstructure:"ilm_policy_name"` | ||
// This stores number of seconds to wait for master node response. By default, it is set to 120 | ||
Timeout int `mapstructure:"timeout"` | ||
// SkipDependencies if set to true will disable rollover for dependencies index | ||
SkipDependencies bool `mapstructure:"skip_dependencies"` | ||
// AdaptiveSampling if set to true will enable rollover for adaptive sampling index | ||
AdaptiveSampling bool `mapstructure:"include_adaptive_sampling"` | ||
} | ||
|
||
// LookBackOptions store the options for a sub-process which is similar to index cleaner of auto rollover of jaeger. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I question why these need to be separate. If I think about the user taking a declarative approach to index rollovers, they would describe the frequency of rotations and how much data to retain, so that the rollover and cleanup are done as a single logical process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these 3 options will be in same common struct of Rollover. Please see this:
I have created different structs because we want to keep the processes of |
||
type LookBackOptions struct { | ||
Manik2708 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Unit is used with lookback to remove indices from read alias e.g, days, weeks, months, years | ||
Unit string `mapstructure:"unit"` | ||
// UnitCount is the count of units for which look-up is performed | ||
UnitCount int `mapstructure:"unit-count"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a copy of What used in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could raise another PR to see if changing to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's ok to have the old command's flags to be a mess, but if we incorporate these into the config which will be used in Jaeger v2 we need to do a clean cut (but backwards compatible). |
||
} | ||
|
||
// RollOverConditions store the conditions required for the rollover operation in the auto-rollover cron job of jaeger. | ||
type RollOverConditions struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to question about LookBackOptions, why is this a separate struct? |
||
// Conditions stores the conditions on which index writing should be performed, for example: "{\"max_age\": \"2d\"}" | ||
Conditions string `mapstructure:"conditions"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. who interprets these conditions? Are they sent to Elasticsearch verbatim? if so let's say so in the comments. |
||
} | ||
|
||
// NewClient creates a new ElasticSearch client | ||
func NewClient(c *Configuration, logger *zap.Logger, metricsFactory metrics.Factory) (es.Client, error) { | ||
if len(c.Servers) < 1 { | ||
|
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.
if you introduce these new types, where are they going to be incorporated into the main Config? We can add them now, I would like to see the full config design.
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 going to be encorprated in the config of es.