kapacitor

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2016 License: MPL-2.0 Imports: 6 Imported by: 0

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 SetTask

func SetTask(task Task) error

SetTask adds or updates a kapacitor task

Types

type Alert

type Alert struct {
	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)
	Threshold int               `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

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