usagemetrics

package
v0.0.0-...-7f66f8e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package usagemetrics provides logging utility for the operational status of Google Cloud Agent for SAP.

Index

Constants

View Source
const (
	StatusRunning       usagemetrics.Status = "RUNNING"
	StatusStarted       usagemetrics.Status = "STARTED"
	StatusStopped       usagemetrics.Status = "STOPPED"
	StatusConfigured    usagemetrics.Status = "CONFIGURED"
	StatusMisconfigured usagemetrics.Status = "MISCONFIGURED"
	StatusError         usagemetrics.Status = "ERROR"
	StatusInstalled     usagemetrics.Status = "INSTALLED"
	StatusUpdated       usagemetrics.Status = "UPDATED"
	StatusUninstalled   usagemetrics.Status = "UNINSTALLED"
	StatusAction        usagemetrics.Status = "ACTION"
)

The following status values are supported.

View Source
const (
	UnknownError                          = 0
	OracleDiscoverDatabaseFailure         = 1
	OracleServiceError                    = 2
	OracleMetricCollectionFailure         = 3
	GCEServiceCreationFailure             = 4
	MetricClientCreationFailure           = 5
	ConnectionParametersReadFailure       = 6
	DatabaseConnectionFailure             = 7
	OracleMetricsCreateWorkerPoolFailure  = 8
	MalformedDefaultOracleQueriesFile     = 9
	MySQLServiceError                     = 10
	MySQLMetricCollectionFailure          = 11
	MySQLDiscoveryFailure                 = 12
	CommonDiscoveryFailure                = 13
	RedisServiceError                     = 14
	RedisMetricCollectionFailure          = 15
	RedisDiscoveryFailure                 = 16
	SQLServerServiceError                 = 17
	SQLServerMetricCollectionFailure      = 18
	SQLServerDiscoveryFailure             = 19
	OracleConnectionFailure               = 20
	OraclePingFailure                     = 21
	SQLServerInvalidConfigurationsError   = 22
	SecretManagerValueError               = 23
	WorkloadManagerConnectionError        = 24
	DataWarehouseActivationServiceFailure = 25
	DataWarehouseWriteInsightFailure      = 26
	PostgresServiceError                  = 27
	PostgresMetricCollectionFailure       = 28
	PostgresDiscoveryFailure              = 29
	OpenShiftServiceError                 = 30
	OpenShiftMetricCollectionFailure      = 31
	MongoDBServiceError                   = 32
	MongoDBMetricCollectionFailure        = 33
	MongoDBDiscoveryFailure               = 34
	StartDaemonFailure                    = 35
	GuestActionsFailure                   = 36
	OpenShiftGenericMetricsFailure        = 37
	OpenShiftWLMRequestFailure            = 38
)

Agent wide error code mappings.

View Source
const (
	UnknownAction                = 0
	SQLServerAgentConfigMigrated = 1
	// SQL Server deployment status codes.
	SQLServerDeploymentSuccess       = 2
	SQLServerDeploymentGlobalTimeout = 3
	SQLServerDeploymentTimeout       = 4
	// Oracle deployment through Oracle-Toolkit.
	OracleToolkitDeploymentSuccess = 5
	OpenShiftWLMRequestSuccess     = 6
)

Agent wide action mappings.

Variables

View Source
var UsageLogger = usagemetrics.NewLogger(nil, nil, clockwork.NewRealClock(), projectExclusionList)

UsageLogger is the standard usage logger for the workload agent.

Functions

func Action

func Action(id int)

Action uses the standard Logger to log the ACTION status.

func Configured

func Configured()

Configured uses the standard Logger to log the CONFIGURED status.

func Error

func Error(id int)

Error uses the standard Logger to log the ERROR status. This status is reported at most once per day.

func Installed

func Installed()

Installed uses the standard Logger to log the INSTALLED status.

func LogActionDaily

func LogActionDaily(id int)

LogActionDaily uses the standard logger to log the ACTION once a day. Should be called exactly once for each ACTION code.

func LogRunningDaily

func LogRunningDaily()

LogRunningDaily log that the agent is running once a day.

func Misconfigured

func Misconfigured()

Misconfigured uses the standard Logger to log the MISCONFIGURED status.

func ParseStatus

func ParseStatus(status string) usagemetrics.Status

ParseStatus parses the status string to a Status enum.

func Running

func Running()

Running uses the standard Logger to log the RUNNING status. This status is reported at most once per day.

func SetAgentProperties

func SetAgentProperties(ap *cpb.AgentProperties)

SetAgentProperties sets the configured agent properties on the standard Logger.

func SetCloudProperties

func SetCloudProperties(cp *cpb.CloudProperties)

SetCloudProperties sets the configured cloud properties on the standard Logger.

func Started

func Started()

Started uses the standard Logger to log the STARTED status.

func Stopped

func Stopped()

Stopped uses the standard Logger to log the STOPPED status.

func Uninstalled

func Uninstalled()

Uninstalled uses the standard Logger to log the UNINSTALLED status.

func Updated

func Updated(version string)

Updated uses the standard Logger to log the UPDATED status.

Types

This section is empty.

Jump to

Keyboard shortcuts

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