Skip to Content
Upblit
AboutOpen SourceCommunityDeveloperContactPricing
Star on GitHub—Sign in
CTRL K
  • Introduction
    • AI Gateway Overview
    • Documents
    • Tenants
    • API Reference Overview
    • AI Gateway API
    • API Keys API
    • Applications API
    • Authentication
    • Ingest API (SDK)
    • Organizations API
    • Projects API
    • Telemetry API
    • Users API
    • Architecture Overview
    • Database Architecture
    • Multi-Tenancy
    • Security Model
    • Service Boundaries
    • Telemetry Pipeline
  • DeployX CLI
    • Contributing
    • Architecture Rules
    • Coding Guidelines
    • SDK Development
    • Dashboard Overview
    • AI Gateway
    • API Keys
    • Applications
    • Observability
    • Organizations
    • Profile
    • Projects
    • Quickstart
    • Authentication
    • Your First Project
    • Installation
    • Observability Overview
    • Structured Logs
    • Telemetry Flow
    • Distributed Traces
    • SDK Overview
    • Express SDK
    • Go SDK
    • Java SDK (Coming Soon)
    • Python SDK
    • React SDK (Coming Soon)
  • Introduction
    • AI Gateway Overview
    • Documents
    • Tenants
    • API Reference Overview
    • AI Gateway API
    • API Keys API
    • Applications API
    • Authentication
    • Ingest API (SDK)
    • Organizations API
    • Projects API
    • Telemetry API
    • Users API
    • Architecture Overview
    • Database Architecture
    • Multi-Tenancy
    • Security Model
    • Service Boundaries
    • Telemetry Pipeline
  • DeployX CLI
    • Contributing
    • Architecture Rules
    • Coding Guidelines
    • SDK Development
    • Dashboard Overview
    • AI Gateway
    • API Keys
    • Applications
    • Observability
    • Organizations
    • Profile
    • Projects
    • Quickstart
    • Authentication
    • Your First Project
    • Installation
    • Observability Overview
    • Structured Logs
    • Telemetry Flow
    • Distributed Traces
    • SDK Overview
    • Express SDK
    • Go SDK
    • Java SDK (Coming Soon)
    • Python SDK
    • React SDK (Coming Soon)

On This Page

  • Installation
  • Basic Setup
  • Options
  • Span Helpers
  • Logging
  • Manual Flush
  • Graceful Shutdown
  • Thread Safety
  • Context Propagation
SdksGo SDK

Go SDK

The Upblit Go SDK instruments your Go HTTP server with distributed tracing and structured logging.

Installation

go get github.com/upblit/go-sdk

Basic Setup

package main import ( "net/http" "os" upblit "github.com/upblit/go-sdk" ) func main() { sdk := upblit.New(os.Getenv("UPBLIT_API_KEY")) defer sdk.Close() mux := http.NewServeMux() mux.HandleFunc("/users/", handleGetUser) // Wrap your handler with the middleware http.ListenAndServe(":8080", sdk.Middleware()(mux)) }

Options

sdk := upblit.New( os.Getenv("UPBLIT_API_KEY"), upblit.WithBaseURL("https://ingest.upblit.com"), // default upblit.WithFlushInterval(30 * time.Second), // default upblit.WithHTTPClient(customHTTPClient), // optional )

Span Helpers

import ( "context" upblit "github.com/upblit/go-sdk" ) // Service span func getUser(ctx context.Context, id string) (*User, error) { result, err := sdk.Service(ctx, "getUserById", func() (any, error) { return db.FindUser(ctx, id) }) return result.(*User), err } // External call span func chargeCard(ctx context.Context, amount int) error { _, err := sdk.Call(ctx, "stripe", func() (any, error) { return nil, stripe.Charge(ctx, amount) }) return err }

Logging

sdk.Log("info", "User signed in") sdk.Log("error", "Payment failed") sdk.Log("fatal", "Database connection lost") // flushed immediately

Manual Flush

// Flush all buffered traces and logs if err := sdk.Flush(ctx); err != nil { log.Printf("flush error: %v", err) }

Graceful Shutdown

sdk := upblit.New(apiKey) defer sdk.Close() // stops background flusher and flushes remaining buffer

Thread Safety

All buffer operations are protected by a sync.Mutex. The SDK is safe to use from multiple goroutines.

Context Propagation

The Go SDK uses context.Context for trace propagation. Pass the context through your call chain and the SDK will automatically link child spans to the correct parent.

Last updated on May 27, 2026
Express SDKJava SDK (Coming Soon)
Upblit

A student-built observability workbench for logs, traces, metrics, API keys, and AI-assisted incident notes.

OAuthAPI scopesTrace contextRetention notes

Product

  • Architecture
  • Dashboard preview
  • AI docs
  • Security
  • Pricing

Developers

  • Developer docs
  • API reference
  • Changelog
  • GitHub
  • Status

Company

  • Support
  • Contact
  • Docs
  • Dashboard
  • Sign in

Legal

  • Privacy Policy
  • Terms
  • Cookie Policy
  • Acceptable Use
  • Data Retention
  • Data Processing

Copyright 2026 Upblit. All rights reserved.

Built for telemetry review, API operations, and incident response.