github getsentry/sentry-go v0.18.0
0.18.0

latest releases: v0.29.1, otel/v0.29.1, v0.29.0...
21 months ago

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.18.0.
This release contains initial support for OpenTelemetry and various other bug fixes and improvements.

Note: This is the last release supporting Go 1.17.

Features

  • Initial support for OpenTelemetry.
    You can now send all your OpenTelemetry spans to Sentry.

    Install the otel module

    go get github.com/getsentry/sentry-go \
           github.com/getsentry/sentry-go/otel

    Configure the Sentry and OpenTelemetry SDKs

    import (
        "go.opentelemetry.io/otel"
        sdktrace "go.opentelemetry.io/otel/sdk/trace"
        "github.com/getsentry/sentry-go"
        "github.com/getsentry/sentry-go/otel"
        // ...
    )
    
    // Initlaize the Sentry SDK
    sentry.Init(sentry.ClientOptions{
        Dsn:              "__DSN__",
        EnableTracing:    true,
        TracesSampleRate: 1.0,
    })
    
    // Set up the Sentry span processor
    tp := sdktrace.NewTracerProvider(
        sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()),
        // ...
    )
    otel.SetTracerProvider(tp)
    
    // Set up the Sentry propagator
    otel.SetTextMapPropagator(sentryotel.NewSentryPropagator())

    You can read more about using OpenTelemetry with Sentry in our docs.

Bug Fixes

  • Do not freeze the Dynamic Sampling Context when no Sentry values are present in the baggage header (#532)
  • Create a frozen Dynamic Sampling Context when calling span.ToBaggage() (#566)
  • Fix baggage parsing and encoding in vendored otel package (#568)

Misc

  • Add Span.SetDynamicSamplingContext() (#539)
  • Add various getters for Dsn (#540)
  • Add SpanOption::SpanSampled (#546)
  • Add Span.SetData() (#542)
  • Add Span.IsTransaction() (#543)
  • Add Span.GetTransaction() method (#558)

Don't miss a new sentry-go release

NewReleases is sending notifications on new releases.