oraclemetrics

package
v0.0.0-...-440265f Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

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

This section is empty.

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

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.

Jump to

Keyboard shortcuts

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