Skip to content

Repository files navigation

api-graveyard-go

Official Go collector for API Graveyard — automatically tracks your outgoing HTTP dependencies, detects risk events, and surfaces zombie APIs before they take down your product.

Install

go get github.com/Shakargy/api-graveyard-go

Quick start

package main

import (
    ag "github.com/Shakargy/api-graveyard-go"
)

func main() {
    ag.Init(ag.Options{
        APIKey:    "agk_your_key_here",
        ProjectID: "your-project-id",
    })
    defer ag.Shutdown()

    // ... rest of your app
    // All outgoing http.DefaultTransport calls are now tracked automatically.
}

That's it. Every outgoing HTTP request made via the standard net/http client is automatically captured, batched, and sent to API Graveyard in the background.

TypeScript / full example

ag.Init(ag.Options{
    APIKey:        os.Getenv("API_GRAVEYARD_KEY"),
    ProjectID:     os.Getenv("API_GRAVEYARD_PROJECT_ID"),
    ServiceName:   "my-backend",
    Environment:   os.Getenv("APP_ENV"),  // "production", "staging", etc.
    FlushInterval: 10,                    // seconds
    MaxBatchSize:  100,
    Debug:         false,
})

Options

Option Type Default Description
APIKey string required Your agk_... API key from the dashboard
ProjectID string required Your project ID from the dashboard
BaseURL string https://api-graveyard.com Override for self-hosted
ServiceName string "" Tag events with a service name
Environment string "production" Tag events with an environment
FlushInterval int 10 How often to flush the event buffer (seconds)
MaxBatchSize int 100 Max events per batch before forcing a flush
Debug bool false Log flush activity

What gets captured

  • Method, URL, HTTP status code, response time
  • Timestamp of each request
  • Service name and environment (if configured)

Requests to api-graveyard.com itself are never captured to avoid infinite loops. Localhost and 127.0.0.1 requests are ignored by default.

Get your API key

  1. Sign up at api-graveyard.com
  2. Create a project
  3. Go to Settings → Integrations and create an API key

License

MIT

About

Official Go collector for API Graveyard — auto-tracks outgoing HTTP dependencies

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages