From 388a06846c7d4979e77e1f17cb4e1b66bec1212c Mon Sep 17 00:00:00 2001 From: Polliog <40077351+Polliog@users.noreply.github.com> Date: Sat, 20 Jun 2026 10:09:52 +0200 Subject: [PATCH] fix stale sdkVersion and document slog handler sdkVersion was left at 0.9.4 through the 1.0.0 release, so the User-Agent header and embedded SDK metadata reported a stale version. Bump it to 1.0.1. Also document the integrations/logtideslog log/slog handler in the README, which was previously undocumented. --- CHANGELOG.md | 10 ++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ client.go | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44d7749..6eee9a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.1] - 2026-06-20 + +### Fixed + +- `sdkVersion` is now `1.0.1`; it was inadvertently left at `0.9.4` in the 1.0.0 release, so the User-Agent header and embedded SDK metadata reported a stale version + +### Documentation + +- README now documents the `integrations/logtideslog` `log/slog` handler + ## [1.0.0] - 2026-06-20 ### Added diff --git a/README.md b/README.md index fa8a369..e1c920c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ - **Retry with backoff** — exponential backoff with jitter - **Circuit breaker** — prevents cascading failures - **OpenTelemetry** — trace/span IDs extracted automatically; span and metric exporters included +- **log/slog handler** — route existing `slog` logging to LogTide with no code changes - **net/http middleware** — per-request scope isolation out of the box - **Thread-safe** — safe for concurrent use @@ -263,6 +264,37 @@ them. --- +## log/slog handler + +Route existing `log/slog` logging through LogTide without changing call sites. +Records honour the full client pipeline (scope merge, processors, BeforeSend, +sampling, batching). Attributes become entry metadata, slog groups become nested +metadata objects, and attribute values implementing `error` are promoted to +structured exceptions for server-side error grouping. + +```go +import ( + "log/slog" + + "github.com/logtide-dev/logtide-sdk-go/integrations/logtideslog" +) + +client, _ := logtide.NewClient(logtide.ClientOptions{ + DSN: "https://lp_abc@api.logtide.dev", + Service: "my-service", +}) + +logger := slog.New(logtideslog.New(client, nil)) +slog.SetDefault(logger) + +slog.Info("user signed up", "user_id", 42) // flows to LogTide +``` + +Pass `&logtideslog.Options{Level: slog.LevelDebug}` to change the minimum level +(defaults to `slog.LevelInfo`). + +--- + ## Flush & shutdown ```go diff --git a/client.go b/client.go index 1e8b65e..9f82386 100644 --- a/client.go +++ b/client.go @@ -10,7 +10,7 @@ import ( ) // sdkVersion is embedded in the User-Agent header and SDK metadata. -const sdkVersion = "0.9.4" +const sdkVersion = "1.0.1" // Client sends log entries to the LogTide ingest endpoint. // Use NewClient for the explicit-lifecycle pattern, or Init + package-level