Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt,omitempty"`
}
Alert represents an Alertmanager alert.
type AlertmanagerClient ¶
type AlertmanagerClient struct {
// contains filtered or unexported fields
}
AlertmanagerClient sends alerts to Alertmanager.
func NewAlertmanagerClient ¶
func NewAlertmanagerClient(baseURL string) *AlertmanagerClient
NewAlertmanagerClient creates a new Alertmanager client.
func (*AlertmanagerClient) PostAlerts ¶
func (a *AlertmanagerClient) PostAlerts(ctx context.Context, alerts []Alert) error
PostAlerts sends alerts to Alertmanager.
type AppMetrics ¶
type AppMetrics struct {
DeploysTotal *prometheus.CounterVec
DeployDurationSeconds prometheus.ObserverVec
RollbacksTotal *prometheus.CounterVec
AgentDiagnosesTotal *prometheus.CounterVec
HealthCheckFailures *prometheus.CounterVec
ActiveDeployments *prometheus.GaugeVec
}
AppMetrics holds all custom DeployIQ Prometheus metrics.
func NewAppMetrics ¶
func NewAppMetrics(reg prometheus.Registerer) *AppMetrics
NewAppMetrics registers and returns all application metrics.
type DashboardPayload ¶
type DashboardPayload struct {
Dashboard map[string]interface{} `json:"dashboard"`
FolderID int `json:"folderId"`
Overwrite bool `json:"overwrite"`
}
DashboardPayload is the Grafana API request structure.
type GrafanaClient ¶
type GrafanaClient struct {
// contains filtered or unexported fields
}
GrafanaClient manages Grafana dashboards via HTTP API.
func NewGrafanaClient ¶
func NewGrafanaClient(baseURL, username, password, apiKey string) *GrafanaClient
NewGrafanaClient creates a new Grafana API client.
func (*GrafanaClient) CreateAnnotation ¶
func (g *GrafanaClient) CreateAnnotation(ctx context.Context, text, release string, t time.Time) error
CreateAnnotation adds a deploy event annotation to Grafana.
func (*GrafanaClient) ProvisionDashboard ¶
func (g *GrafanaClient) ProvisionDashboard(ctx context.Context, dashboardPath string) error
ProvisionDashboard uploads a dashboard JSON to Grafana.
type MetricsQuerier ¶
type MetricsQuerier interface {
GetErrorRate(ctx context.Context, deployment, namespace, window string) (float64, error)
GetP99Latency(ctx context.Context, deployment, namespace, window string) (float64, error)
GetP95Latency(ctx context.Context, deployment, namespace, window string) (float64, error)
GetCPUUsage(ctx context.Context, deployment, namespace string) (float64, error)
GetMemoryUsage(ctx context.Context, deployment, namespace string) (float64, error)
GetPodRestarts(ctx context.Context, deployment, namespace, window string) (float64, error)
QueryInstant(ctx context.Context, query string) (float64, error)
}
MetricsQuerier defines the interface for querying Prometheus.
func NewPrometheusClient ¶
func NewPrometheusClient(url string) (MetricsQuerier, error)
NewPrometheusClient creates a new Prometheus query client.