Skip to content

Commit

Permalink
chore: renamed event properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardomaraschini committed Oct 3, 2023
1 parent 03ee9a4 commit 5227604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/metrics/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (e UpgradeFailed) Title() string {
// JoinStarted event is send back home when a node join starts.
type JoinStarted struct {
ClusterID uuid.UUID `json:"clusterID"`
Name string `json:"name"`
NodeName string `json:"nodeName"`
}

// Title returns the name of the event.
Expand All @@ -92,7 +92,7 @@ func (e JoinSucceeded) Title() string {
// JoinFailed event is send back home when a node join fails.
type JoinFailed struct {
ClusterID uuid.UUID `json:"clusterID"`
Name string `json:"name"`
NodeName string `json:"nodeName"`
Reason string `json:"reason"`
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/metrics/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func ReportJoinSucceeded(ctx context.Context, clusterID uuid.UUID) {
}

// ReportJoinFailed reports that a join has failed.
func ReportJoinFailed(ctx context.Context, clusterID uuid.UUID, err error) {
func ReportJoinFailed(ctx context.Context, clusterID uuid.UUID, exterr error) {
hostname, err := os.Hostname()
if err != nil {
logrus.Warnf("unable to get hostname: %s", err)
hostname = "unknown"
}
Send(ctx, JoinFailed{clusterID, hostname, err.Error()})
Send(ctx, JoinFailed{clusterID, hostname, exterr.Error()})
}

// ReportApplyStarted decides if we are going to report an InstallationStarted
Expand Down

0 comments on commit 5227604

Please sign in to comment.