Skip to content

Commit

Permalink
More Metronome -> Lago renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAraujo committed May 15, 2024
1 parent 3bfe751 commit 07e9090
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/server/handlers/billing/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (c *CreateBillingHandler) grantRewardIfReferral(ctx context.Context, referr
}

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
expiresAt := time.Now().AddDate(5, 0, 0)
name := "Referral reward"
Expand Down
2 changes: 1 addition & 1 deletion api/server/handlers/billing/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *IngestEventsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
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 {
for i := range ingestEventsRequest.Events {
ingestEventsRequest.Events[i].CustomerID = fmt.Sprintf("porter-cloud-%s", ingestEventsRequest.Events[i].CustomerID)
Expand Down
1 change: 0 additions & 1 deletion api/server/handlers/cluster/install_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func (c *InstallAgentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
"clusterID": fmt.Sprintf("%d", cluster.ID),
"projectID": fmt.Sprintf("%d", proj.ID),
"prometheusURL": c.Config().ServerConf.PrometheusUrl,
"metronomeKey": c.Config().ServerConf.LagoAPIKey,
},
"loki": map[string]interface{}{},
}
Expand Down
2 changes: 1 addition & 1 deletion api/server/handlers/project/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
err := p.Config().BillingManager.LagoClient.CreateCustomerWithPlan(ctx, user.Email, proj.Name, proj.ID, proj.BillingID, proj.EnableSandbox)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions api/server/handlers/project/referrals.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func (c *GetProjectReferralDetailsHandler) ServeHTTP(w http.ResponseWriter, r *h
c.WriteResult(w, r, "")

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
}
Expand Down
2 changes: 1 addition & 1 deletion api/types/billing_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Trial struct {
EndingBefore string `json:"ending_before"`
}

// BillingEvent represents a Metronome billing event.
// BillingEvent represents a Lago billing event.
type BillingEvent struct {
CustomerID string `json:"customer_id"`
EventType string `json:"event_type"`
Expand Down

0 comments on commit 07e9090

Please sign in to comment.