kapacitor

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package kapacitor provides the means for alerting if a stat exceeds a threshold.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTask

func DeleteTask(id string) error

DeleteTask removes a kapacitor task

func GenBatchTick

func GenBatchTick(stat, database, retentionPolicy, measurement string, where map[string]string, period, every string, alerts map[string]string, post string) string

GenBatchTick generates a simple batch type TICKscript

func Init

func Init() error

Init initializes the client

func ListTask added in v0.2.2

func ListTask(id string) (client.Task, error)

ListTask lists a kapacitor task

func ListTasks added in v0.2.2

func ListTasks() ([]client.Task, error)

ListTasks lists all kapacitor task

func SetTask

func SetTask(task Task) error

SetTask adds or updates a kapacitor task

Types

type Alert

type Alert struct {
	Id        string            `json:"id"`              // id of task created (for returning to user)
	Tags      map[string]string `json:"tags,omitempty"`  // populates the WHERE
	Metric    string            `json:"metric"`          // the stat to track
	Level     string            `json:"level,omitempty"` // the alert level (info, warn, crit)
	Operator  string            `json:"operator"`        // comparison operator used (bash style - gt, lt, le, ge, eq, ne)
	Threshold string            `json:"threshold"`       // limit that alert is triggered
	Duration  string            `json:"duration"`        // how far back to average (5m)
	Post      string            `json:"post"`            // api to hit when alert is triggered
}

Alert is an object to simplify creating tasks

func (*Alert) GenId added in v0.1.0

func (alrt *Alert) GenId()

type Task

type Task struct {
	Id              string `json:"id"`
	Type            string `json:"type"`
	Database        string `json:"database"`
	RetentionPolicy string `json:"retention-policy"`
	Script          string `json:"script"`
	Status          string `json:"status"`
}

Task is an object for registering kapacitor tasks

Jump to

Keyboard shortcuts

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