datadog

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteExtinctMonitors

func DeleteExtinctMonitors(monitors []string, tags []string) error

DeleteExtinctMonitors gathers monitors configured with all tags in variable tags; If any are not present in variable monitors they get deleted.

func GetMock

func GetMock(ctrl *gomock.Controller) *mocks.MockClientAPI

GetMock will return a mock datadog client API

Types

type ClientAPI

type ClientAPI interface {
	CreateMonitor(*ddapi.Monitor) (*ddapi.Monitor, error)
	DeleteMonitor(id int) error
	GetMonitorsByMonitorTags(tags []string) ([]ddapi.Monitor, error)
	MuteMonitorScope(id int, muteMonitorScope *ddapi.MuteMonitorScope) error
	UnmuteMonitor(id int) error
	UpdateMonitor(*ddapi.Monitor) error
}

ClientAPI defines the interface for the Datadog client, for testing purposes

type DDMonitorManager

type DDMonitorManager struct {
	Datadog ClientAPI
	// contains filtered or unexported fields
}

DDMonitorManager is a higher-level wrapper around the Datadog API

func GetInstance

func GetInstance() *DDMonitorManager

GetInstance returns a singleton DDMonitorManager, creating it if necessary

func (*DDMonitorManager) AddOrUpdate

func (ddman *DDMonitorManager) AddOrUpdate(monitor *ddapi.Monitor) (*ddapi.Monitor, error)

AddOrUpdate will create a monitor if it doesn't exist or update one if it does. It returns the Id of the monitor created or updated.

func (*DDMonitorManager) DeleteMonitor

func (ddman *DDMonitorManager) DeleteMonitor(monitor *ddapi.Monitor) error

DeleteMonitor deletes a monitor

func (*DDMonitorManager) DeleteMonitors

func (ddman *DDMonitorManager) DeleteMonitors(tags []string) error

DeleteMonitors deletes monitors containing the specified tags.

func (*DDMonitorManager) GetProvisionedMonitor

func (ddman *DDMonitorManager) GetProvisionedMonitor(monitor *ddapi.Monitor) (*ddapi.Monitor, error)

GetProvisionedMonitor returns a monitor with the same name from Datadog.

func (*DDMonitorManager) GetProvisionedMonitors

func (ddman *DDMonitorManager) GetProvisionedMonitors() ([]ddapi.Monitor, error)

GetProvisionedMonitors returns a collection of monitors managed by astro.

Jump to

Keyboard shortcuts

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