> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traceback.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK

> Instrument Go services, HTTP handlers, Gin, and gRPC with Traceback.

## Installation

```bash theme={null}
go get github.com/traceback-dev/traceback-go
```

***

## Basic Usage & Panic Recovery

```go theme={null}
package main

import (
	"log"
	"net/http"
	"time"

	"github.com/traceback-dev/traceback-go"
	tbhttp "github.com/traceback-dev/traceback-go/http"
)

func main() {
	err := traceback.Init(traceback.ClientOptions{
		Dsn:         "https://tb_live_key@ingest.traceback.dev/1",
		Environment: "production",
		Release:     "v1.4.0",
		TracesSampleRate: 1.0,
	})
	if err != nil {
		log.Fatalf("traceback.Init: %s", err)
	}
	defer traceback.Flush(2 * time.Second)

	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		panic("Unexpected nil pointer dereference")
	})

	http.Handle("/", tbhttp.NewHandler(handler))
	log.Fatal(http.ListenAndServe(":8080", nil))
}
```
