mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
24 lines
467 B
Go
24 lines
467 B
Go
package datadog
|
|
|
|
import (
|
|
"github.com/wtfutil/wtf/utils"
|
|
datadog "github.com/zorkian/go-datadog-api"
|
|
)
|
|
|
|
// Monitors returns a list of newrelic monitors
|
|
func (widget *Widget) Monitors() ([]datadog.Monitor, error) {
|
|
client := datadog.NewClient(
|
|
widget.settings.apiKey,
|
|
widget.settings.applicationKey,
|
|
)
|
|
|
|
tags := utils.ToStrs(widget.settings.tags)
|
|
|
|
monitors, err := client.GetMonitorsByTags(tags)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return monitors, nil
|
|
}
|