Explore seamless integration with BetterStack's powerful APIs using this Golang SDK. This personal project is crafted to streamline your development process, offering a robust set of tools for interacting with Betterstack services. While it's not officially affiliated with BetterStack, this SDK aims to provide a convenient and efficient way for developers to enhance their projects with the flexibility of the BetterStack Golang SDK.
go get -u github.com/sudodeo/betterstack-go/sdk
To run this project, you will need to add the following environment variables to your .env file
UPTIME_API_TOKEN
To obtain your uptime API token, view instructions from BetterStack
LOGS_API_TOKEN
To obtain your logs API token, view instructions from BetterStack
- Monitors
- Monitor groups
- Heartbeats
- Heartbeat groups
- On-call calendar
- Escalation policies
- Incidents
- New Relic Integrations
- Datadog Integrations
- AWS Cloudwatch Integrations
- Azure Integrations
- Google Monitoring Integrations
- Grafana Integrations
- Prometheus Integrations
- Email Integrations
- Incoming webhooks
- Splunk On-call Integrations
- PagerDuty Integrations
- Status Pages
- Status Pages Sections
- Status Pages Resources
- Status Pages Reports
- Status Pages Report Updates
- Metadata
- Sources
- Query
package main
import (
"github.com/sudodeo/betterstack-go/sdk"
betterstack "github.com/sudodeo/betterstack-go/sdk/uptime" // for uptime API
)
func main(){
bs, err := betterstack..New(&sdk.Config{APIToken: token, APIType: "uptime"})
if err != nil {
panic(err)
}
incidents, err := bs.ListIncidents()
if err != nil {
panic(err)
}
log.Println(incidents)
}