Skip to content
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

fix(xp-treatment): Add field tags to poller configs and make XP plugin pass poller configs #88

17 changes: 9 additions & 8 deletions plugins/turing/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ type TreatmentServicePluginConfig struct {
Port int `json:"port" default:"8080"`
PubSubTimeoutSeconds int `json:"pub_sub_timeout_seconds" validate:"required"`

AssignedTreatmentLogger config.AssignedTreatmentLoggerConfig `json:"assigned_treatment_logger"`
DebugConfig config.DebugConfig `json:"debug_config"`
DeploymentConfig config.DeploymentConfig `json:"deployment_config"`
ManagementService config.ManagementServiceConfig `json:"management_service"`
MonitoringConfig config.Monitoring `json:"monitoring_config"`
SwaggerConfig config.SwaggerConfig `json:"swagger_config"`
NewRelicConfig newrelic.Config `json:"new_relic_config"`
SentryConfig sentry.Config `json:"sentry_config"`
AssignedTreatmentLogger config.AssignedTreatmentLoggerConfig `json:"assigned_treatment_logger"`
DebugConfig config.DebugConfig `json:"debug_config"`
DeploymentConfig config.DeploymentConfig `json:"deployment_config"`
ManagementService config.ManagementServiceConfig `json:"management_service"`
MonitoringConfig config.Monitoring `json:"monitoring_config"`
SwaggerConfig config.SwaggerConfig `json:"swagger_config"`
NewRelicConfig newrelic.Config `json:"new_relic_config"`
SentryConfig sentry.Config `json:"sentry_config"`
ManagementServicePollerConfig config.ManagementServicePollerConfig `json:"management_service_poller_config"`
}

type Variable struct {
Expand Down
23 changes: 12 additions & 11 deletions plugins/turing/manager/experiment_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,18 @@ func (em *experimentManager) MakeTreatmentServicePluginConfig(
projectID int,
) (*config.Config, error) {
pluginConfig := &config.Config{
Port: em.TreatmentServicePluginConfig.Port,
ProjectIds: []string{strconv.Itoa(projectID)},
AssignedTreatmentLogger: em.TreatmentServicePluginConfig.AssignedTreatmentLogger,
DebugConfig: em.TreatmentServicePluginConfig.DebugConfig,
DeploymentConfig: em.TreatmentServicePluginConfig.DeploymentConfig,
ManagementService: em.TreatmentServicePluginConfig.ManagementService,
MonitoringConfig: em.TreatmentServicePluginConfig.MonitoringConfig,
SwaggerConfig: em.TreatmentServicePluginConfig.SwaggerConfig,
NewRelicConfig: em.TreatmentServicePluginConfig.NewRelicConfig,
SentryConfig: em.TreatmentServicePluginConfig.SentryConfig,
SegmenterConfig: *treatmentServiceConfig.SegmenterConfig,
Port: em.TreatmentServicePluginConfig.Port,
ProjectIds: []string{strconv.Itoa(projectID)},
AssignedTreatmentLogger: em.TreatmentServicePluginConfig.AssignedTreatmentLogger,
DebugConfig: em.TreatmentServicePluginConfig.DebugConfig,
DeploymentConfig: em.TreatmentServicePluginConfig.DeploymentConfig,
ManagementService: em.TreatmentServicePluginConfig.ManagementService,
MonitoringConfig: em.TreatmentServicePluginConfig.MonitoringConfig,
SwaggerConfig: em.TreatmentServicePluginConfig.SwaggerConfig,
NewRelicConfig: em.TreatmentServicePluginConfig.NewRelicConfig,
SentryConfig: em.TreatmentServicePluginConfig.SentryConfig,
SegmenterConfig: *treatmentServiceConfig.SegmenterConfig,
ManagementServicePollerConfig: em.TreatmentServicePluginConfig.ManagementServicePollerConfig,
deadlycoconuts marked this conversation as resolved.
Show resolved Hide resolved
}
messageQueueKind := *treatmentServiceConfig.MessageQueueConfig.Kind
switch messageQueueKind {
Expand Down
4 changes: 2 additions & 2 deletions treatment-service/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ type ManagementServiceConfig struct {
}

type ManagementServicePollerConfig struct {
Enabled bool `default:"false"`
PollInterval time.Duration `default:"30s"`
Enabled bool `json:"enabled" default:"false"`
PollInterval time.Duration `json:"poll_interval" default:"30s"`
}

func (c *Config) GetProjectIds() []models.ProjectId {
Expand Down
Loading