apihandler

package
v0.0.0-...-771c5c2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertHandler

func AlertHandler(a *APIContext, w http.ResponseWriter, r *http.Request) (int, error)

AlertHandler ...

Types

type APIContext

type APIContext struct {
	Config      *saconfig.EventConfiguration
	AMQP1Sender *amqp10.AMQPSender
}

APIContext ...

func NewAPIContext

func NewAPIContext(serverConfig saconfig.EventConfiguration) *APIContext

NewAPIContext ...

type Alert

type Alert struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	StartsAt    string            `json:"startsAt,omitempty"`
	EndsAt      string            `json:"EndsAt,omitempty"`
}

Alert is a single alert.

type EventMetricHandler

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

EventMetricHandler ....

func NewAppStateEventMetricHandler

func NewAppStateEventMetricHandler(applicationHealth *cacheutil.ApplicationHealthCache) *EventMetricHandler

NewAppStateEventMetricHandler ...

func (*EventMetricHandler) Collect

func (eventMetricHandler *EventMetricHandler) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*EventMetricHandler) Describe

func (eventMetricHandler *EventMetricHandler) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type Handler

type Handler struct {
	*APIContext
	H func(c *APIContext, w http.ResponseWriter, r *http.Request) (int, error)
}

Handler ...

func (Handler) ServeHTTP

func (ah Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP...

type HookMessage

type HookMessage struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	Status            string            `json:"status"`
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []Alert           `json:"alerts"`
}

HookMessage is the message we receive from Alertmanager

type MetricHandler

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

MetricHandler ...metric handlers

func NewAppStateMetricHandler

func NewAppStateMetricHandler(applicationHealth *cacheutil.ApplicationHealthCache) *MetricHandler

NewAppStateMetricHandler ...

func (*MetricHandler) Collect

func (metricHandler *MetricHandler) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*MetricHandler) Describe

func (metricHandler *MetricHandler) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type Timestamp

type Timestamp time.Time

Timestamp is a helper for (un)marhalling time

Jump to

Keyboard shortcuts

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