Documentation
¶
Overview ¶
Package usagemetrics provides logging utility for the operational status of Google Cloud Agent for SAP.
Index ¶
- Constants
- Variables
- func Action(id int)
- func Configured()
- func Error(id int)
- func Installed()
- func LogActionDaily(id int)
- func LogRunningDaily()
- func Misconfigured()
- func ParseStatus(status string) usagemetrics.Status
- func Running()
- func SetAgentProperties(ap *cpb.AgentProperties)
- func SetCloudProperties(cp *cpb.CloudProperties)
- func Started()
- func Stopped()
- func Uninstalled()
- func Updated(version string)
Constants ¶
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.
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.
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 ¶
var UsageLogger = usagemetrics.NewLogger(nil, nil, clockwork.NewRealClock(), projectExclusionList)
UsageLogger is the standard usage logger for the workload agent.
Functions ¶
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 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 Uninstalled ¶
func Uninstalled()
Uninstalled uses the standard Logger to log the UNINSTALLED status.
Types ¶
This section is empty.