Skip to content

Instantly share code, notes, and snippets.

@gronnbeck gronnbeck/main.go Secret
Created Mar 8, 2016

Embed
What would you like to do?
func main() {
c := cron.New()
c.AddFunc("@every 30s", func() {
url = os.Getenv("SYNTHETIC_URL")
apitoken = os.Getenv("SYNTHETIC_API_TOKEN")
result := syn.SyntheticHttpRequest(url, apitoken)
if result == syn.ConnectionError {
datadog.ReportConnectionError()
} else if result == syn.UnexpectedResponse {
datadog.ReportUnexpectedResponse()
} else {
datadog.ReportOK()
}
})
c.Start()
// Keep the process from exiting
d := make(chan string)
<-d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.