Skip to content

Commit

Permalink
CPBUGSM-30853: Defaulting metrics from all installed clusters to prod…
Browse files Browse the repository at this point in the history
… telemeter.

Until now, in the service, we changed the default behaviour of openshift,
which is to always send cluster metrics to prod-telemeter-server unless
changed by the user, and we:
    * left untouched clusters created by cloud prod env
    * redirected to telemeter-stage stage clusters
    * redirected to dummy-url all other clusters

The issue with this approach is that all prod clusters that aren't
created in the cloud, operator clusters for example,  will fail to
deliver telemetry.

Instead, we will now default to prod-telemeter instead of dummy-url
unless we know better:
    * left untouched clusters created by ALL prod envs (not just cloud)
    * redirect to telemeter-stage stage clusters
    * redirect to dummy-url integration clusters

Signed-off-by: Yoni Bettan <ybettan@redhat.com>
  • Loading branch information
ybettan committed Jun 14, 2021
1 parent 0b3a8e5 commit 8b50d61
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions internal/network/manifests_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ data:
telemeterServerURL: {{.TELEMETER_SERVER_URL}}
`

prodServiceBaseURL = "https://api.openshift.com"
stageServiceBaseURL = "https://api.stage.openshift.com"
stageTelemeterURL = "https://infogw.api.stage.openshift.com"
dummyURL = "https://dummy.com"
prodServiceBaseURL = "https://api.openshift.com"
stageServiceBaseURL = "https://api.stage.openshift.com"
integrationServiceBaseURL = "https://api.integration.openshift.com"
stageTelemeterURL = "https://infogw.api.stage.openshift.com"
dummyURL = "https://dummy.com"
)

// Default Telemeter server is prod.
Expand All @@ -308,20 +309,21 @@ func (m *ManifestsGenerator) AddTelemeterManifest(ctx context.Context, log logru

manifestParams := map[string]string{}

if m.Config.ServiceBaseURL == prodServiceBaseURL {
return nil
}
switch m.Config.ServiceBaseURL {

if m.Config.ServiceBaseURL == stageServiceBaseURL {
case stageServiceBaseURL:

log.Infof("Creating manifest to redirect metrics from installed cluster to telemeter-stage")
manifestParams["TELEMETER_SERVER_URL"] = stageTelemeterURL

} else {
case integrationServiceBaseURL:

log.Infof("Creating manifest to redirect metrics from installed cluster to a dummy URL")
log.Infof("Creating manifest to redirect metrics from installed cluster to dummy URL")
manifestParams["TELEMETER_SERVER_URL"] = dummyURL

default:
return nil

}

content, err := fillTemplate(manifestParams, redirectTelemeterStageManifest, log)
Expand Down

0 comments on commit 8b50d61

Please sign in to comment.