Просмотр исходного кода

More Metronome -> Lago renaming

Mauricio Araujo 2 лет назад
Родитель
Сommit
08a01fdff2

+ 1 - 1
api/server/handlers/billing/create.go

@@ -147,7 +147,7 @@ func (c *CreateBillingHandler) grantRewardIfReferral(ctx context.Context, referr
 	}
 	}
 
 
 	if referral != nil && referral.Status != models.ReferralStatusCompleted {
 	if referral != nil && referral.Status != models.ReferralStatusCompleted {
-		// Metronome requires an expiration to be passed in, so we set it to 5 years which in
+		// Lago requires an expiration to be passed in, so we set it to 5 years which in
 		// practice will mean the credits will most likely run out before expiring
 		// practice will mean the credits will most likely run out before expiring
 		expiresAt := time.Now().AddDate(5, 0, 0)
 		expiresAt := time.Now().AddDate(5, 0, 0)
 		name := "Referral reward"
 		name := "Referral reward"

+ 1 - 1
api/server/handlers/billing/ingest.go

@@ -64,7 +64,7 @@ func (c *IngestEventsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 		telemetry.AttributeKV{Key: "usage-events-count", Value: len(ingestEventsRequest.Events)},
 		telemetry.AttributeKV{Key: "usage-events-count", Value: len(ingestEventsRequest.Events)},
 	)
 	)
 
 
-	// For Porter Cloud events, we apend a prefix to avoid collisions before sending to Metronome
+	// For Porter Cloud events, we apend a prefix to avoid collisions before sending to Lago
 	if proj.EnableSandbox {
 	if proj.EnableSandbox {
 		for i := range ingestEventsRequest.Events {
 		for i := range ingestEventsRequest.Events {
 			ingestEventsRequest.Events[i].CustomerID = fmt.Sprintf("porter-cloud-%s", ingestEventsRequest.Events[i].CustomerID)
 			ingestEventsRequest.Events[i].CustomerID = fmt.Sprintf("porter-cloud-%s", ingestEventsRequest.Events[i].CustomerID)

+ 0 - 1
api/server/handlers/cluster/install_agent.go

@@ -112,7 +112,6 @@ func (c *InstallAgentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 			"clusterID":     fmt.Sprintf("%d", cluster.ID),
 			"clusterID":     fmt.Sprintf("%d", cluster.ID),
 			"projectID":     fmt.Sprintf("%d", proj.ID),
 			"projectID":     fmt.Sprintf("%d", proj.ID),
 			"prometheusURL": c.Config().ServerConf.PrometheusUrl,
 			"prometheusURL": c.Config().ServerConf.PrometheusUrl,
-			"metronomeKey":  c.Config().ServerConf.LagoAPIKey,
 		},
 		},
 		"loki": map[string]interface{}{},
 		"loki": map[string]interface{}{},
 	}
 	}

+ 1 - 1
api/server/handlers/project/create.go

@@ -99,7 +99,7 @@ func (p *ProjectCreateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 		)
 		)
 	}
 	}
 
 
-	// Create Metronome customer and add to starter plan
+	// Create Lago customer and add to starter plan
 	if p.Config().BillingManager.LagoConfigLoaded && proj.GetFeatureFlag(models.LagoEnabled, p.Config().LaunchDarklyClient) {
 	if p.Config().BillingManager.LagoConfigLoaded && proj.GetFeatureFlag(models.LagoEnabled, p.Config().LaunchDarklyClient) {
 		err := p.Config().BillingManager.LagoClient.CreateCustomerWithPlan(ctx, user.Email, proj.Name, proj.ID, proj.BillingID, proj.EnableSandbox)
 		err := p.Config().BillingManager.LagoClient.CreateCustomerWithPlan(ctx, user.Email, proj.Name, proj.ID, proj.BillingID, proj.EnableSandbox)
 		if err != nil {
 		if err != nil {

+ 2 - 2
api/server/handlers/project/referrals.go

@@ -37,8 +37,8 @@ func (c *GetProjectReferralDetailsHandler) ServeHTTP(w http.ResponseWriter, r *h
 		c.WriteResult(w, r, "")
 		c.WriteResult(w, r, "")
 
 
 		telemetry.WithAttributes(span,
 		telemetry.WithAttributes(span,
-			telemetry.AttributeKV{Key: "metronome-config-exists", Value: c.Config().BillingManager.LagoConfigLoaded},
-			telemetry.AttributeKV{Key: "metronome-enabled", Value: proj.GetFeatureFlag(models.LagoEnabled, c.Config().LaunchDarklyClient)},
+			telemetry.AttributeKV{Key: "lago-config-exists", Value: c.Config().BillingManager.LagoConfigLoaded},
+			telemetry.AttributeKV{Key: "lago-enabled", Value: proj.GetFeatureFlag(models.LagoEnabled, c.Config().LaunchDarklyClient)},
 		)
 		)
 		return
 		return
 	}
 	}

+ 1 - 1
api/types/billing_usage.go

@@ -49,7 +49,7 @@ type Trial struct {
 	EndingBefore string `json:"ending_before"`
 	EndingBefore string `json:"ending_before"`
 }
 }
 
 
-// BillingEvent represents a Metronome billing event.
+// BillingEvent represents a Lago billing event.
 type BillingEvent struct {
 type BillingEvent struct {
 	CustomerID    string                 `json:"customer_id"`
 	CustomerID    string                 `json:"customer_id"`
 	EventType     string                 `json:"event_type"`
 	EventType     string                 `json:"event_type"`