Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProjectFind = errors.New("项目查询失败") ErrProjectDeploymentK8sGet = errors.New("项目查询失败,请检查Kubernetes是否存在") ErrProjectToken = errors.New("项目Token校验错误") ErrProjectEventNotPush = errors.New("EventName not push") ErrProjectDeploymentGet = errors.New("项目Deployment获取错误") ErrProjectMemberGet = errors.New("build用户获取错误,可能不存在") ErrProjectJenkinsBuild = errors.New("调用Jenkins Build错误") )
View Source
var ErrLimitExceed = errors.New("Rate limit exceed!")
Functions ¶
Types ¶
type Annotations ¶
type Label ¶
type Label struct { AlertName string `json:"alertname"` Container string `json:"container"` ContainerName string `json:"container_name"` Deployment string `json:"deployment"` Instance string `json:"instance"` Job string `json:"job"` K8sApp string `json:"k8s_app"` KubernetesName string `json:"kubernetes_name"` KubernetesNamespace string `json:"kubernetes_namespace"` Namespace string `json:"namespace"` Pod string `json:"pod"` Severity string `json:"severity"` SearchID string `json:"searchID"` DestinationService string `json:"destination_service"` SourceService string `json:"source_service"` }
type Prom ¶
type Prom struct { Receiver string `json:"receiver"` Status string `json:"status"` Alerts []Alert `json:"alerts"` GroupLabels struct { AlertName string `json:"alertname"` } `json:"groupLabels"` CommonLabels Label `json:"commonLabels"` CommonAnnotations struct { Summary string `json:"summary"` Description string `json:"description"` } `json:"common_annotations"` Labels string `json:"labels"` ExternalURL string `json:"externalURL"` StartsAt string `json:"startsAt"` EndsAt string `json:"endsAt"` GroupKey string `json:"group_key"` Version string `json:"version"` }
type PrometheusAlerts ¶
type PrometheusAlerts interface { Get() (prom Prom) String() string Alerts() []Alert GetName(label *Label) string GetNamespace(label *Label) string GetAlertName() string GetDesc() string From(alert *Alert) string To(alert *Alert) string }
func NewPrometheusAlerts ¶
func NewPrometheusAlerts(body []byte) (p PrometheusAlerts, err error)
type Service ¶
type Service interface { // gitlab post过来的数据 GitPost(ctx context.Context, namespace, name, token, keyWord, branch string, req gitlabHook) (err error) // prometheus 的告警数据 PrometheusAlert(ctx context.Context, req *prometheusAlerts) error // 获取配置信息 Config(ctx context.Context) (res map[string]interface{}, err error) }
func NewInstrumentingService ¶
func NewService ¶
func NewService(logger log.Logger, cf *config.Config, amqpClient amqpClient.AmqpClient, k8sClient kubernetes.K8sClient, jenkins jenkins.Jenkins, repository repository.Repository) Service
Click to show internal directories.
Click to hide internal directories.