diff --git a/pkg/3scale/amp/operator/apicast_options_provider_test.go b/pkg/3scale/amp/operator/apicast_options_provider_test.go index 9357c4e80..fe65c8cd5 100644 --- a/pkg/3scale/amp/operator/apicast_options_provider_test.go +++ b/pkg/3scale/amp/operator/apicast_options_provider_test.go @@ -73,6 +73,24 @@ func testApicastProductionPodLabels() map[string]string { } } +func testApicastStagingMonitoringLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "apicast", + "threescale_component_element": "staging", + "monitoring-key": "middleware", + } +} + +func testApicastProductionMonitoringLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "apicast", + "threescale_component_element": "production", + "monitoring-key": "middleware", + } +} + func basicApimanagerTestApicastOptions() *appsv1alpha1.APIManager { tmpApicastManagementAPI := apicastManagementAPI tmpOpenSSLVerify := openSSLVerify @@ -110,6 +128,8 @@ func defaultApicastOptions() *component.ApicastOptions { CommonProductionLabels: testApicastProductionLabels(), StagingPodTemplateLabels: testApicastStagingPodLabels(), ProductionPodTemplateLabels: testApicastProductionPodLabels(), + StagingMonitoringLabels: testApicastStagingMonitoringLabels(), + ProductionMonitoringLabels: testApicastProductionMonitoringLabels(), } } diff --git a/pkg/3scale/amp/operator/backend_options_provider_test.go b/pkg/3scale/amp/operator/backend_options_provider_test.go index 6615874f7..1d10f64c3 100644 --- a/pkg/3scale/amp/operator/backend_options_provider_test.go +++ b/pkg/3scale/amp/operator/backend_options_provider_test.go @@ -95,6 +95,24 @@ func testBackendCronPodLabels() map[string]string { } } +func testBackendMonitoringListenerLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "backend", + "threescale_component_element": "listener", + "monitoring-key": "middleware", + } +} + +func testBackendMonitoringWorkerLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "backend", + "threescale_component_element": "worker", + "monitoring-key": "middleware", + } +} + func getInternalSecret() *v1.Secret { data := map[string]string{ component.BackendSecretInternalApiUsernameFieldName: "someUserName", @@ -164,6 +182,8 @@ func defaultBackendOptions(opts *component.BackendOptions) *component.BackendOpt ListenerPodTemplateLabels: testBackendListenerPodLabels(), WorkerPodTemplateLabels: testBackendWorkerPodLabels(), CronPodTemplateLabels: testBackendCronPodLabels(), + ListenerMonitoringLabels: testBackendMonitoringListenerLabels(), + WorkerMonitoringLabels: testBackendMonitoringWorkerLabels(), } } diff --git a/pkg/3scale/amp/operator/system_options_provider_test.go b/pkg/3scale/amp/operator/system_options_provider_test.go index 0b919a997..b4c9b72d2 100644 --- a/pkg/3scale/amp/operator/system_options_provider_test.go +++ b/pkg/3scale/amp/operator/system_options_provider_test.go @@ -133,6 +133,14 @@ func testSystemSMTPLabels() map[string]string { "threescale_component_element": "smtp", } } +func testSystemSidekiqMonitoringLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "system", + "threescale_component_element": "sidekiq", + "monitoring-key": "middleware", + } +} func basicApimanagerSpecTestSystemOptions() *appsv1alpha1.APIManager { tmpSystemAppReplicas := systemAppReplicas @@ -294,6 +302,7 @@ func defaultSystemOptions(opts *component.SystemOptions) *component.SystemOption SphinxPodTemplateLabels: testSystemSphinxPodTemplateLabels(), MemcachedLabels: testSystemMemcachedLabels(), SMTPLabels: testSystemSMTPLabels(), + SidekiqMonitoringLabels: testSystemSidekiqMonitoringLabels(), } expectedOpts.ApicastSystemMasterProxyConfigEndpoint = component.DefaultApicastSystemMasterProxyConfigEndpoint(opts.ApicastAccessToken) diff --git a/pkg/3scale/amp/operator/zync_options_provider_test.go b/pkg/3scale/amp/operator/zync_options_provider_test.go index 4a46aa7c1..b0bcf0816 100644 --- a/pkg/3scale/amp/operator/zync_options_provider_test.go +++ b/pkg/3scale/amp/operator/zync_options_provider_test.go @@ -96,6 +96,24 @@ func testZyncDatabasePodTemplateCommonLabels() map[string]string { } } +func testZyncZyncMonitoringLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "zync", + "threescale_component_element": "zync", + "monitoring-key": "middleware", + } +} + +func testZyncQueMonitoringLabels() map[string]string { + return map[string]string{ + "app": appLabel, + "threescale_component": "zync", + "threescale_component_element": "zync-que", + "monitoring-key": "middleware", + } +} + func getZyncSecret() *v1.Secret { data := map[string]string{ component.ZyncSecretKeyBaseFieldName: zyncSecretKeyBasename, @@ -136,6 +154,8 @@ func defaultZyncOptions(opts *component.ZyncOptions) *component.ZyncOptions { ZyncPodTemplateLabels: testZyncPodTemplateLabels(), ZyncQuePodTemplateLabels: testZyncQuePodTemplateCommonLabels(), ZyncDatabasePodTemplateLabels: testZyncDatabasePodTemplateCommonLabels(), + ZyncMonitoringLabels: testZyncZyncMonitoringLabels(), + ZyncQueMonitoringLabels: testZyncQueMonitoringLabels(), } expectedOpts.DatabaseURL = component.DefaultZyncDatabaseURL(expectedOpts.DatabasePassword)