Documentation
¶
Overview ¶
Package oraclemetrics queries Oracle database and sends the results as metrics to Cloud Monitoring.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthStatus ¶
type HealthStatus string
HealthStatus is the health status of a database.
const ( // Healthy is the healthy status of the database. Healthy HealthStatus = "Healthy" // Unhealthy is the unhealthy status of the database. Unhealthy HealthStatus = "Unhealthy" // Unknown is the unknown status of the database. Unknown HealthStatus = "Unknown" )
type MetricCollector ¶
type MetricCollector struct {
Config *configpb.Configuration
TimeSeriesCreator cloudmonitoring.TimeSeriesCreator
BackOffs *cloudmonitoring.BackOffIntervals
GCEService gceInterface
// contains filtered or unexported fields
}
MetricCollector holds the parameters required for metric collection.
func New ¶
func New(ctx context.Context, config *configpb.Configuration) (*MetricCollector, error)
New initializes and returns the MetricCollector struct.
func (*MetricCollector) SendDefaultMetricsToCloudMonitoring ¶
func (c *MetricCollector) SendDefaultMetricsToCloudMonitoring(ctx context.Context) []*mrpb.TimeSeries
SendDefaultMetricsToCloudMonitoring submits a task for each database connection to the worker pool. Each task executes a query from default_queries.json and sends the results as metrics to Cloud Monitoring.
func (*MetricCollector) SendHealthMetricsToCloudMonitoring ¶
func (c *MetricCollector) SendHealthMetricsToCloudMonitoring(ctx context.Context) []*mrpb.TimeSeries
SendHealthMetricsToCloudMonitoring sends health metrics to Cloud Monitoring.
type ServiceHealth ¶
type ServiceHealth struct {
Status HealthStatus
LastChecked time.Time
Message string // Optional message (e.g., reason for unhealthy status)
}
ServiceHealth holds the health information for a specific service.
Click to show internal directories.
Click to hide internal directories.