announcement go sdk product

Introducing the Loggy Go SDK: First-Class Observability for Go Applications

We're excited to announce the official Loggy SDK for Go! Get logging, distributed tracing, and performance metrics in your Go applications with the same great developer experience you love from our Node.js SDK.

L
Loggy Team
· 5 min read

We’ve been getting requests for a Go SDK since we launched, and today we’re thrilled to finally deliver. The Loggy Go SDK brings everything you love about our Node.js SDK to the Go ecosystem: beautiful colored console output, remote log aggregation, distributed tracing with W3C Trace Context support, and performance metrics tracking.

Why Go?

Go has become the language of choice for building reliable, high-performance backend services. From Kubernetes to Docker to countless microservices powering the modern web, Go is everywhere. We wanted to make sure Go developers have first-class observability tools that feel native to the language, not like an afterthought.

When we set out to build this SDK, we didn’t just port our Node.js code. We rebuilt it from the ground up with Go idioms in mind. The result is an SDK that feels natural to Go developers while maintaining API consistency with our other SDKs.

Getting Started

Installation is a single command:

go get github.com/loggy-dev/loggy-go

And getting your first logs flowing is just as simple:

package main

import (
    "os"
    loggy "github.com/loggy-dev/loggy-go"
)

func main() {
    logger := loggy.New(loggy.Config{
        Identifier: "my-service",
        Timestamp:  true,
        Color:      true,
        Remote: &loggy.RemoteConfig{
            Token: os.Getenv("LOGGY_TOKEN"),
        },
    })

    logger.Info("Application started")
    logger.Info("User logged in", map[string]interface{}{
        "userId": 12345,
        "role":   "admin",
    })

    // Don't forget to flush before exit
    defer logger.Flush()
}

Your logs will appear both in your terminal with beautiful colored output and in your Loggy dashboard in real-time.

Distributed Tracing Built In

One of the features we’re most excited about is the distributed tracing support. If you’re running microservices (and let’s be honest, if you’re using Go, you probably are), tracing is essential for understanding how requests flow through your system.

The Go SDK supports W3C Trace Context out of the box, which means it plays nicely with other tracing systems and propagates context automatically:

tracer := loggy.NewTracer(loggy.TracerConfig{
    ServiceName:    "api-gateway",
    ServiceVersion: "1.0.0",
    Environment:    "production",
    Remote: &loggy.TracerRemoteConfig{
        Token: os.Getenv("LOGGY_TOKEN"),
    },
})

// Start a span for an operation
span := tracer.StartSpan("handle-request", &loggy.SpanOptions{
    Kind: loggy.SpanKindServer,
    Attributes: map[string]interface{}{
        "http.method": "GET",
        "http.path":   "/api/users",
    },
})

// Do your work...

span.End()

We’ve also included HTTP middleware that automatically traces incoming requests and propagates context to outgoing ones:

handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    // Your handler code
})

// Wrap with tracing middleware
http.Handle("/", loggy.TracingMiddleware(tracer, handler))

Performance Metrics

The SDK also includes performance metrics tracking, giving you visibility into your application’s throughput and response times:

metrics := loggy.NewMetrics(loggy.MetricsConfig{
    Token:    os.Getenv("LOGGY_TOKEN"),
    Endpoint: "https://loggy.dev/api/metrics/ingest",
})

// Use the middleware for automatic tracking
http.Handle("/", loggy.MetricsMiddleware(metrics, handler))

You’ll get RPM (requests per minute), response time distributions, status code breakdowns, and throughput metrics, all visualized beautifully in your Loggy dashboard.

Log-Trace Correlation

One of the most powerful features is the ability to correlate your logs with traces. When you’re debugging an issue, you can click on a trace and see all the logs that were generated during that request, across all your services:

// Get the current span context
ctx := span.Context()

// Include trace context in your logs
logger.Info("Processing order", map[string]interface{}{
    "traceId": ctx.TraceID,
    "spanId":  ctx.SpanID,
    "orderId": "ORD-12345",
})

This makes debugging distributed systems so much easier. No more grepping through logs trying to piece together what happened.

What’s Next

This is just the beginning for our Go SDK. We’re already working on:

  • Automatic instrumentation for popular Go libraries like database/sql, net/http, and gRPC
  • OpenTelemetry compatibility for teams already using OTel
  • More middleware options for popular frameworks like Gin, Echo, and Chi

We’d love to hear your feedback! The SDK is open source at github.com/loggy-dev/loggy-go, and we welcome issues, feature requests, and contributions.

Try It Today

The Go SDK is available now for all Loggy users. If you’re on the Free tier, you can start logging immediately. Pro and Team users get access to distributed tracing and performance metrics.

go get github.com/loggy-dev/loggy-go

Happy logging! 🚀

Ready to simplify your logging?

Join developers who are already using Loggy to debug faster.

Get Started for Free