Skip to content

sudodeo/betterstack-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BetterStack-Go

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.

Installation

go get -u github.com/sudodeo/betterstack-go/sdk

Environment Variables

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

Documentation

Uptime API Documentation

Logs API Documentation

Features

Uptime

  • 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

Logs

  • Sources
  • Query

Usage/Examples

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)
}

Author