You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

alertruleslogic.go 755 B

12345678910111213141516171819202122232425262728293031323334
  1. package monitoring
  2. import (
  3. "context"
  4. "github.com/prometheus/alertmanager/api/v2/client/alert"
  5. "github.com/zeromicro/go-zero/core/logx"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
  7. )
  8. type AlertRulesLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewAlertRulesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AlertRulesLogic {
  14. return &AlertRulesLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *AlertRulesLogic) AlertRules() error {
  21. // todo: add your logic here and delete this line
  22. alerts, err := l.svcCtx.AlertClient.Alert.GetAlerts(&alert.GetAlertsParams{})
  23. if err != nil {
  24. return err
  25. }
  26. println(alerts.Error())
  27. return nil
  28. return nil
  29. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.