rabbitpushgnotifier

package
v0.0.0-...-d38b3e6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package rabbitpushgnotifier contains a simple ViolationsNotifier that send violations to a rabbit queue and also the queries to Prometheus needed to get all the information about the violation.

Package rabbitpushgnotifier contains a simple ViolationsNotifier that send violations to a rabbit queue.

Index

Constants

View Source
const (
	// PushgatewayURLPropertyName is the config property name of the Pushgateway URL
	PushgatewayURLPropertyName = "pushgatewayUrl"
	// RabbitMQPropertyName is the config property name of the Rabbit connection
	RabbitMQPropertyName = "rabbitMQ"
	// Name is the unique identifier of this notifier
	Name = "rabbitpushg"
	// PrometheusURLPropertyName is the config property name of the Prometheus URL
	PrometheusURLPropertyName = "prometheusUrl"
)

Variables

This section is empty.

Functions

func ChecknotStartedFunctions

func ChecknotStartedFunctions(prometheusRootURL string, jobId string, resource string) []string

*

  • ChecknotStartedFunctions queries Prometheus for the functions that didn't start from a job.
  • Returns a []string with the instances ids of no started functions, e.g. []string{"935882-0-A000-00002", "935882-0-A000-00003"}

func ConnectQueue

func ConnectQueue(rabURL string) error

ConnectQueue connect to Rabbit queue

func New

New constructs a Rabbitpushg Notifier

func SendViolationToPrometheus

func SendViolationToPrometheus(pushg string, agr string, gua string, key string, violtime string, fun string, listlen int)

SendViolationToPrometheus violations to prometheus via pushgateway

Types

type QueryResp

type QueryResp struct {
	Status string `json:"status"`
	Data   data   `json:"data"`
}

func Query

func Query(m string, prometheusRootURL string) (QueryResp, error)

*

  • Query single query to prometheus

type RabbitpushgNotifier

type RabbitpushgNotifier struct {
	// contains filtered or unexported fields
}

RabbitpushgNotifier logs violations on a Rabbit queue and on a Pushgateway monitor.

func (RabbitpushgNotifier) NotifyViolations

func (n RabbitpushgNotifier) NotifyViolations(agreement *model.Agreement, result *assessment_model.Result)

NotifyViolations implements ViolationNotifier interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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