diff --git a/pkg/cluster/install.go b/pkg/cluster/install.go index 8123a001c5e..ef6d3a52d75 100644 --- a/pkg/cluster/install.go +++ b/pkg/cluster/install.go @@ -375,7 +375,7 @@ func (m *manager) Install(ctx context.Context) error { steps.Condition(m.ingressControllerReady, 30*time.Minute, true), steps.Action(m.configureDefaultStorageClass), steps.Action(m.finishInstallation), - steps.Action(m.emitFeatures), + steps.Action(m.gatherEmitInstallMetrics), }, } diff --git a/pkg/cluster/install_metrics.go b/pkg/cluster/install_metrics.go index bff122afec5..ea2e51816f9 100644 --- a/pkg/cluster/install_metrics.go +++ b/pkg/cluster/install_metrics.go @@ -20,26 +20,10 @@ const ( defaultSet = "Default" ) -func (m *manager) emitFeatures(ctx context.Context) error { - dimensions := map[string]string{ - "resourceid": m.doc.ResourceID, - "subscriptionid": m.env.SubscriptionID(), - "location": m.doc.OpenShiftCluster.Location, - "resourcegroup": m.doc.OpenShiftCluster.Properties.ClusterProfile.ResourceGroupID, - "name": m.doc.OpenShiftCluster.Name, - "ocpversion": m.doc.OpenShiftCluster.Properties.ClusterProfile.Version, - "workercount": strconv.FormatInt(int64(len(m.doc.OpenShiftCluster.Properties.WorkerProfiles)), 10), - } +func (m *manager) gatherEmitInstallMetrics(ctx context.Context) error { + dimensions := map[string]string{} - for flag, feature := range m.doc.OpenShiftCluster.Properties.OperatorFlags { - dimensions[flag] = feature - } - - if m.doc.OpenShiftCluster.Tags != nil { - dimensions["tags"] = enabled - } else { - dimensions["tags"] = disabled - } + m.gatherMiscMetrics(dimensions) err := m.gatherAuthMetrics(dimensions) if err != nil { @@ -61,6 +45,28 @@ func (m *manager) emitFeatures(ctx context.Context) error { return nil } +func (m *manager) gatherMiscMetrics(dimensions map[string]string) { + dimensions["resourceid"] = m.doc.ResourceID + dimensions["subscriptionid"] = m.env.SubscriptionID() + dimensions["tenantid"] = m.env.TenantID() + dimensions["location"] = m.doc.OpenShiftCluster.Location + dimensions["resourcegroup"] = m.doc.OpenShiftCluster.Properties.ClusterProfile.ResourceGroupID + dimensions["name"] = m.doc.OpenShiftCluster.Name + dimensions["ocpversion"] = m.doc.OpenShiftCluster.Properties.ClusterProfile.Version + dimensions["workercount"] = strconv.FormatInt(int64(len(m.doc.OpenShiftCluster.Properties.WorkerProfiles)), 10) + dimensions["rpversion"] = m.doc.OpenShiftCluster.Properties.ProvisionedBy + + for flag, feature := range m.doc.OpenShiftCluster.Properties.OperatorFlags { + dimensions[flag] = feature + } + + if m.doc.OpenShiftCluster.Tags != nil { + dimensions["tags"] = enabled + } else { + dimensions["tags"] = disabled + } +} + func (m *manager) gatherNodeMetrics(dimensions map[string]string) error { if m.doc.OpenShiftCluster.Properties.MasterProfile.DiskEncryptionSetID != "" { dimensions["masterprofile.diskencryptionsetid"] = enabled