irontelemetry-go/README.md

4.0 KiB

IronTelemetry

IronTelemetry SDK for Go

Error monitoring and crash reporting for Go applications

Go Reference License: MIT

WebsiteDocumentationGo GuideGit


IronTelemetry helps you capture exceptions, track user journeys, and get actionable insights to fix issues faster. Built for developers who want simple, powerful error monitoring without the complexity.

Features

  • Panic Recovery - Automatically capture panics with full stack traces
  • Error Capture - Report errors with context and metadata
  • Journey Tracking - Understand what users did before an error occurred
  • Breadcrumbs - Add context with custom breadcrumbs
  • Context Support - Full context.Context support for cancellation
  • Thread-Safe - All operations are safe for concurrent use
  • Zero Dependencies - Minimal external dependencies

Installation

go get git.marketally.com/ironservices/irontelemetry-go

Quick Start

Initialize the SDK

package main

import (
    "log"
    irontelemetry "git.marketally.com/ironservices/irontelemetry-go"
)

func main() {
    client, err := irontelemetry.New(irontelemetry.Options{
        DSN: "https://pk_live_xxx@irontelemetry.com",
    })
    if err != nil {
        log.Fatal(err)
    }
    defer client.Close()
}

Capture Errors

if err := doSomething(); err != nil {
    client.CaptureException(err)
}

Track User Journeys

journey := client.StartJourney("Checkout Flow")
journey.SetUser("user-123", "user@example.com", "John Doe")

err := journey.RunStep("Validate Cart", irontelemetry.CategoryBusiness, func() error {
    return validateCart()
})
if err != nil {
    journey.Fail(err)
    client.CaptureException(err)
    return
}

journey.Complete()

Add Breadcrumbs

client.AddBreadcrumb("User clicked checkout button", irontelemetry.CategoryUI)
client.AddBreadcrumb("Payment API called", irontelemetry.CategoryHTTP)

HTTP Middleware

http.Handle("/", irontelemetry.HTTPHandler(client, myHandler))

Configuration

client, err := irontelemetry.New(irontelemetry.Options{
    DSN:         "https://pk_live_xxx@irontelemetry.com",
    Environment: "production",
    AppVersion:  "1.2.3",
    SampleRate:  1.0,
    BeforeSend: func(event *irontelemetry.TelemetryEvent) *irontelemetry.TelemetryEvent {
        return event
    },
})

Documentation

For complete documentation, visit irontelemetry.com/docs.

Other SDKs

Platform Package
JavaScript/TypeScript @ironservices/telemetry
.NET IronTelemetry.Client
Python irontelemetry
Java irontelemetry-java
Rust irontelemetry

Support

License

MIT License - see LICENSE for details.