observability

package
v0.0.0-...-a834cfb Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: UPL-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownValue = "UNKNOWN"
	DefaultValue = "DEFAULT"
)
View Source
const (
	StatusObservabilityPending v1alpha1.StatusEnum = "PENDING"
	StatusObservabilityError   v1alpha1.StatusEnum = "ERROR"
	StatusObservabilityReady   v1alpha1.StatusEnum = "READY"
)

Observability Status

View Source
const (
	LogReconcile               = "ObservabilityExporterLogger"
	LogExportersDeploy         = "ObservabilityExporterDeploymentLogger"
	LogExportersSVC            = "ObservabilityExporterServiceLogger"
	LogExportersServiceMonitor = "ObservabilityExporterServiceMonitorLogger"
)

Log Names

View Source
const (
	DefaultDbUserKey                 = "username"
	DefaultDBPasswordKey             = "password"
	DefaultDBConnectionStringKey     = "connection"
	DefaultLabelKey                  = "app"
	DefaultConfigVolumeString        = "config-volume"
	DefaultWalletVolumeString        = "creds"
	DefaultOCIPrivateKeyVolumeString = "ocikey"
	DefaultOCIConfigFingerprintKey   = "fingerprint"
	DefaultOCIConfigRegionKey        = "region"
	DefaultOCIConfigTenancyKey       = "tenancy"
	DefaultOCIConfigUserKey          = "user"

	DefaultExporterImage                 = "container-registry.oracle.com/database/observability-exporter:1.1.0"
	DefaultServicePort                   = 9161
	DefaultServiceTargetPort             = 9161
	DefaultPrometheusPort                = "metrics"
	DefaultReplicaCount                  = 1
	DefaultExporterConfigMountRootPath   = "/oracle/observability"
	DefaultOracleHome                    = "/lib/oracle/21/client64/lib"
	DefaultOracleTNSAdmin                = DefaultOracleHome + "/network/admin"
	DefaultExporterConfigmapFilename     = "config.toml"
	DefaultVaultPrivateKeyRootPath       = "/oracle/config"
	DefaultPrivateKeyFileKey             = "privatekey"
	DefaultPrivateKeyFileName            = "private.pem"
	DefaultVaultPrivateKeyAbsolutePath   = DefaultVaultPrivateKeyRootPath + "/" + DefaultPrivateKeyFileName
	DefaultExporterConfigmapAbsolutePath = DefaultExporterConfigMountRootPath + "/" + DefaultExporterConfigmapFilename
)

Defaults

View Source
const (
	DefaultServiceMonitorPrefix     = "obs-servicemonitor-"
	DefaultLabelPrefix              = "obs-"
	DefaultExporterDeploymentPrefix = "obs-deploy-"
	DefaultExporterContainerName    = "observability-exporter"
)

default resource prefixes

View Source
const (
	EnvVarOracleHome                   = "ORACLE_HOME"
	EnvVarDataSourceUser               = "DB_USERNAME"
	EnvVarDataSourcePassword           = "DB_PASSWORD"
	EnvVarDataSourceConnectString      = "DB_CONNECT_STRING"
	EnvVarDataSourcePwdVaultSecretName = "VAULT_SECRET_NAME"
	EnvVarDataSourcePwdVaultId         = "VAULT_ID"
	EnvVarCustomConfigmap              = "CUSTOM_METRICS"
	EnvVarTNSAdmin                     = "TNS_ADMIN"
	EnvVarVaultTenancyOCID             = "vault_tenancy_ocid"
	EnvVarVaultUserOCID                = "vault_user_ocid"
	EnvVarVaultFingerprint             = "vault_fingerprint"
	EnvVarVaultPrivateKeyPath          = "vault_private_key_path"
	EnvVarVaultRegion                  = "vault_region"
)

Known environment variables

View Source
const (
	IsCRAvailable                 = "ExporterReady"
	IsExporterDeploymentReady     = "DeploymentReady"
	IsExporterServiceReady        = "ServiceReady"
	IsExporterServiceMonitorReady = "ServiceMonitorReady"
)

Positive ConditionTypes

View Source
const (
	ReasonInitStart                      = "InitializationStarted"
	ReasonReadyValidated                 = "ReadinessValidated"
	ReasonValidationInProgress           = "ReadinessValidationInProgress"
	ReasonReadyFailed                    = "ReadinessValidationFailed"
	ReasonDeploymentSpecValidationFailed = "SpecValidationFailed"

	ReasonDeploymentSuccessful   = "ResourceDeployed"
	ReasonDeploymentUpdated      = "ResourceDeploymentUpdated"
	ReasonDeploymentUpdateFailed = "ResourceDeploymentUpdateFailed"
	ReasonDeploymentFailed       = "ResourceDeploymentFailed"
	ReasonDeploymentPending      = "ResourceDeploymentInProgress"

	ReasonGeneralResourceGenerationFailed            = "ResourceGenerationFailed"
	ReasonGeneralResourceCreated                     = "ResourceCreated"
	ReasonGeneralResourceCreationFailed              = "ResourceCreationFailed"
	ReasonGeneralResourceValidationCompleted         = "ResourceDeployed"
	ReasonGeneralResourceValidationFailureDueToError = "ResourceCouldNotBeValidated"
)

Reason

View Source
const (
	ErrorCRRetrieve                           = "an error occurred with retrieving the cr"
	ErrorStatusUpdate                         = "an error occurred with updating the cr status"
	ErrorSpecValidationFailedDueToAnError     = "an error occurred with validating the exporter deployment spec"
	ErrorDeploymentPodsFailure                = "an error occurred with deploying exporter deployment pods"
	ErrorDeploymentUpdate                     = "an error occurred with updating exporter deployment"
	ErrorResourceCreationFailure              = "an error occurred with creating databaseobserver resource"
	ErrorResourceRetrievalFailureDueToAnError = "an error occurred with retrieving databaseobserver resource"
)

Log Errors

View Source
const (
	LogCRStart         = "Started DatabaseObserver instance reconciliation"
	LogCREnd           = "Ended DatabaseObserver instance reconciliation, resource must have been deleted."
	LogResourceCreated = "Created DatabaseObserver resource successfully"
	LogResourceUpdated = "Updated DatabaseObserver resource successfully"
	LogResourceFound   = "Validated DatabaseObserver resource readiness"
)

Log Infos

View Source
const (
	MessageCRInitializationStarted = "Started initialization of custom resource"
	MessageCRValidated             = "Completed validation of custom resource readiness successfully"
	MessageCRValidationFailed      = "Failed to validate readiness of custom resource due to an error"
	MessageCRValidationWaiting     = "Waiting for other resources to be ready to fully validate readiness"

	MessageResourceCreated                   = "Completed creation of resource successfully"
	MessageResourceCreationFailed            = "Failed to create resource due to an error"
	MessageResourceReadinessValidated        = "Completed validation of resource readiness"
	MessageResourceReadinessValidationFailed = "Failed to validate resource due to an error retrieving resource"
	MessageResourceGenerationFailed          = "Failed to generate resource due to an error"

	MessageExporterDeploymentSpecValidationFailed = "Failed to validate export deployment spec due to an error with the spec"
	MessageExporterDeploymentImageUpdated         = "Completed updating exporter deployment image successfully"
	MessageExporterDeploymentEnvironmentUpdated   = "Completed updating exporter deployment environment values successfully"
	MessageExporterDeploymentReplicaUpdated       = "Completed updating exporter deployment replicaCount successfully"
	MessageExporterDeploymentVolumesUpdated       = "Completed updating exporter deployment volumes successfully"
	MessageExporterDeploymentUpdateFailed         = "Failed to update exporter deployment due to an error"
	MessageExporterDeploymentValidationFailed     = "Failed to validate exporter deployment due to an error retrieving resource"
	MessageExporterDeploymentSuccessful           = "Completed validation of exporter deployment readiness"
	MessageExporterDeploymentFailed               = "Failed to deploy exporter deployment due to PodFailure"
	MessageExporterDeploymentListingFailed        = "Failed to list exporter deployment pods"
	MessageExporterDeploymentPending              = "Waiting for exporter deployment pods to be ready"
)

Messages

View Source
const (
	EventReasonFailedCRRetrieval  = "ExporterRetrievalFailed"
	EventMessageFailedCRRetrieval = "Encountered error retrieving databaseObserver instance"

	EventReasonSpecError                                 = "DeploymentSpecValidationFailed"
	EventMessageSpecErrorDBPasswordMissing               = "Spec validation failed due to missing dbPassword field values"
	EventMessageSpecErrorDBPasswordSecretMissing         = "Spec validation failed due to required dbPassword secret not found"
	EventMessageSpecErrorDBConnectionStringSecretMissing = "Spec validation failed due to required dbConnectionString secret not found"
	EventMessageSpecErrorDBPUserSecretMissing            = "Spec validation failed due to dbUser secret not found"
	EventMessageSpecErrorConfigmapMissing                = "Spec validation failed due to custom config configmap not found"
	EventMessageSpecErrorDBWalletSecretMissing           = "Spec validation failed due to provided dbWallet secret not found"

	EventReasonUpdateSucceeded              = "ExporterDeploymentUpdated"
	EventMessageUpdatedImageSucceeded       = "Exporter deployment image updated successfully"
	EventMessageUpdatedEnvironmentSucceeded = "Exporter deployment environment values updated successfully"
	EventMessageUpdatedVolumesSucceeded     = "Exporter deployment volumes updated successfully"
	EventMessageUpdatedReplicaSucceeded     = "Exporter deployment replicaCount updated successfully"
)

Event Recorder Outputs

Variables

This section is empty.

Functions

func GetExporterDeploymentVolumeMounts

func GetExporterDeploymentVolumeMounts(api *apiv1.DatabaseObserver) []corev1.VolumeMount

GetExporterDeploymentVolumeMounts function retrieves volume mounts from api or provides default

func GetExporterDeploymentVolumes

func GetExporterDeploymentVolumes(api *apiv1.DatabaseObserver) []corev1.Volume

GetExporterDeploymentVolumes function retrieves volumes from api or provides default

func GetExporterEnvs

func GetExporterEnvs(api *apiv1.DatabaseObserver) []corev1.EnvVar

GetExporterEnvs function retrieves env from api or provides default

func GetExporterImage

func GetExporterImage(api *apiv1.DatabaseObserver) string

GetExporterImage function retrieves image from api or provides default

func GetExporterLabels

func GetExporterLabels(api *apiv1.DatabaseObserver) map[string]string

GetExporterLabels function retrieves exporter labels from api or provides default

func GetExporterReplicas

func GetExporterReplicas(api *apiv1.DatabaseObserver) int32

GetExporterReplicas function retrieves replicaCount from api or provides default

func GetExporterSelector

func GetExporterSelector(api *apiv1.DatabaseObserver) map[string]string

GetExporterSelector function retrieves labels from api or provides default

func GetExporterServiceMonitorPort

func GetExporterServiceMonitorPort(api *apiv1.DatabaseObserver) string

GetExporterServiceMonitorPort function retrieves exporter service monitor port from api or provides default

func GetExporterServicePort

func GetExporterServicePort(api *apiv1.DatabaseObserver) int32

GetExporterServicePort function retrieves exporter service port from api or provides default

func IsUpdateRequiredForContainerImage

func IsUpdateRequiredForContainerImage(desired *appsv1.Deployment, found *appsv1.Deployment) bool

func IsUpdateRequiredForEnvironmentVars

func IsUpdateRequiredForEnvironmentVars(desired *appsv1.Deployment, found *appsv1.Deployment) bool

func IsUpdateRequiredForReplicas

func IsUpdateRequiredForReplicas(desired *appsv1.Deployment, found *appsv1.Deployment) bool

func IsUpdateRequiredForVolumes

func IsUpdateRequiredForVolumes(desired *appsv1.Deployment, found *appsv1.Deployment) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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