metrics

package
v0.11.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseURL

func BaseURL() string

BaseURL determines the base url to be used when sending metrics over.

func ClusterID

func ClusterID() uuid.UUID

ClusterID returns the cluster id. It is read from from a local file (if this is a second attempt at installation or an upgrade) or a new one is generated and stored locally. TODO: this should be persisted in the cluster as part of a CRD managed by our operator, as we don't have an operator yet, we are storing it locally only.

func LicenseID

func LicenseID() string

LicenseID returns the embedded license id. If something goes wrong, it returns an empty string.

func ReportApplyFinished

func ReportApplyFinished(c *cli.Context, err error)

ReportApplyFinished decides if we are going to report an InstallationSucceeded, an InstallationFailed, an UpgradeSucceeded, or an UpgradeFailed event and calls the appropriate function.

func ReportApplyStarted

func ReportApplyStarted(c *cli.Context)

ReportApplyStarted decides if we are going to report an InstallationStarted or an UpgradeStarted event and calls the appropriate function.

func ReportInstallationFailed

func ReportInstallationFailed(ctx context.Context, err error)

ReportInstallationFailed reports that the installation has failed.

func ReportInstallationStarted

func ReportInstallationStarted(ctx context.Context)

ReportInstallationStarted reports that the installation has started.

func ReportInstallationSucceeded

func ReportInstallationSucceeded(ctx context.Context)

ReportInstallationSucceeded reports that the installation has succeeded.

func ReportJoinFailed

func ReportJoinFailed(ctx context.Context, clusterID uuid.UUID, exterr error)

ReportJoinFailed reports that a join has failed.

func ReportJoinStarted

func ReportJoinStarted(ctx context.Context, clusterID uuid.UUID)

ReportJoinStarted reports that a join has started.

func ReportJoinSucceeded

func ReportJoinSucceeded(ctx context.Context, clusterID uuid.UUID)

ReportJoinSucceeded reports that a join has finished successfully.

func ReportNodeUpgradeFailed

func ReportNodeUpgradeFailed(ctx context.Context, exterr error)

ReportNodeUpgradeFailed reports that node upgrade has failed.

func ReportNodeUpgradeStarted

func ReportNodeUpgradeStarted(ctx context.Context)

ReportNodeUpgradeStarted reports that a node upgrade has started.

func ReportNodeUpgradeSucceeded

func ReportNodeUpgradeSucceeded(ctx context.Context)

ReportNodeUpgradeSucceeded reports that a node upgrade has finished successfully.

func ReportUpgradeFailed

func ReportUpgradeFailed(ctx context.Context, err error)

ReportUpgradeFailed reports that the upgrade has failed.

func ReportUpgradeStarted

func ReportUpgradeStarted(ctx context.Context)

ReportUpgradeStarted reports that the upgrade has started.

func ReportUpgradeSucceeded

func ReportUpgradeSucceeded(ctx context.Context)

ReportUpgradeSucceeded reports that the upgrade has succeeded.

func Send

func Send(ctx context.Context, ev Event)

Send is a helper function that sends an event to the metrics endpoint. Metrics endpoint can be overwritten by the license.spec.endpoint field or by the EMBEDDED_CLUSTER_METRICS_BASEURL environment variable, the latter has precedence over the former.

Types

type Event

type Event interface {
	Title() string
}

Event is implemented by all events. Title returns a string that identifies the event type.

type InstallationFailed

type InstallationFailed struct {
	ClusterID uuid.UUID `json:"clusterID"`
	Reason    string    `json:"reason"`
}

InstallationFailed event is send back home when the installation fails.

func (InstallationFailed) Title

func (e InstallationFailed) Title() string

Title returns the name of the event.

type InstallationStarted

type InstallationStarted struct {
	ClusterID  uuid.UUID `json:"clusterID"`
	Version    string    `json:"version"`
	Flags      string    `json:"flags"`
	BinaryName string    `json:"binaryName"`
	Type       string    `json:"type"`
	LicenseID  string    `json:"licenseID"`
}

InstallationStarted event is send back home when the installation starts.

func (InstallationStarted) Title

func (e InstallationStarted) Title() string

Title returns the name of the event.

type InstallationSucceeded

type InstallationSucceeded struct {
	ClusterID uuid.UUID `json:"clusterID"`
}

InstallationSucceeded event is send back home when the installation finishes.

func (InstallationSucceeded) Title

func (e InstallationSucceeded) Title() string

Title returns the name of the event.

type JoinFailed

type JoinFailed struct {
	ClusterID uuid.UUID `json:"clusterID"`
	NodeName  string    `json:"nodeName"`
	Reason    string    `json:"reason"`
}

JoinFailed event is send back home when a node join fails.

func (JoinFailed) Title

func (e JoinFailed) Title() string

Title returns the name of the event.

type JoinStarted

type JoinStarted struct {
	ClusterID uuid.UUID `json:"clusterID"`
	NodeName  string    `json:"nodeName"`
}

JoinStarted event is send back home when a node join starts.

func (JoinStarted) Title

func (e JoinStarted) Title() string

Title returns the name of the event.

type JoinSucceeded

type JoinSucceeded JoinStarted

JoinSucceeded event is send back home when a node join succeeds.

func (JoinSucceeded) Title

func (e JoinSucceeded) Title() string

Title returns the name of the event.

type NodeUpgradeFailed

type NodeUpgradeFailed JoinFailed

NodeUpgradeFailed event is send back home when a node upgrade fails.

func (NodeUpgradeFailed) Title

func (e NodeUpgradeFailed) Title() string

Title returns the name of the event.

type NodeUpgradeStarted

type NodeUpgradeStarted JoinStarted

NodeUpgradeStarted event is send back home when a node upgrade starts.

func (NodeUpgradeStarted) Title

func (e NodeUpgradeStarted) Title() string

Title returns the name of the event.

type NodeUpgradeSucceeded

type NodeUpgradeSucceeded NodeUpgradeStarted

NodeUpgradeSucceeded event is send back home when a node upgrade succeeds.

func (NodeUpgradeSucceeded) Title

func (e NodeUpgradeSucceeded) Title() string

Title returns the name of the event.

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender sends events to the metrics endpoint.

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, ev Event)

Send sends an event to the metrics endpoint.

type UpgradeFailed

type UpgradeFailed InstallationFailed

UpgradeFailed event is send back home when the upgrade fails.

func (UpgradeFailed) Title

func (e UpgradeFailed) Title() string

Title returns the name of the event.

type UpgradeStarted

type UpgradeStarted InstallationStarted

UpgradeStarted event is send back home when the upgrade starts.

func (UpgradeStarted) Title

func (e UpgradeStarted) Title() string

Title returns the name of the event.

type UpgradeSucceeded

type UpgradeSucceeded InstallationSucceeded

UpgradeSucceeded event is send back home when the upgrade finishes.

func (UpgradeSucceeded) Title

func (e UpgradeSucceeded) Title() string

Title returns the name of the event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL