Documentation
¶
Index ¶
- func NewOtelIntegration() sentry.Integration
- func NewSentryPropagator() propagation.TextMapPropagatordeprecated
- func NewSentrySpanProcessor() otelSdkTrace.SpanProcessordeprecated
- type SentrySpanMapdeprecated
- func (ssm *SentrySpanMap) Clear()
- func (ssm *SentrySpanMap) Get(traceID otelTrace.TraceID, spanID otelTrace.SpanID) (*sentry.Span, bool)
- func (ssm *SentrySpanMap) GetTransaction(traceID otelTrace.TraceID) (*TransactionEntry, bool)
- func (ssm *SentrySpanMap) Len() int
- func (ssm *SentrySpanMap) MarkFinished(spanID otelTrace.SpanID, traceID otelTrace.TraceID)
- func (ssm *SentrySpanMap) Set(spanID otelTrace.SpanID, span *sentry.Span, traceID otelTrace.TraceID)
- type TransactionEntrydeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOtelIntegration ¶ added in v0.45.0
func NewOtelIntegration() sentry.Integration
NewOtelIntegration registers OpenTelemetry linking with Sentry.
It links captured Sentry errors, logs, and metrics to the active OpenTelemetry trace when a context carrying an active OTel span is used.
func NewSentryPropagator
deprecated
func NewSentryPropagator() propagation.TextMapPropagator
NewSentryPropagator creates a propagator for Sentry trace headers.
Deprecated: This propagator depends on the span-processor integration and does not work for OTLP-based setups. Prefer the standard OpenTelemetry propagators. Will be removed in 0.47.0.
For more details: https://github.com/getsentry/sentry-go/issues/1221
func NewSentrySpanProcessor
deprecated
func NewSentrySpanProcessor() otelSdkTrace.SpanProcessor
NewSentrySpanProcessor creates an OpenTelemetry span processor that mirrors OTel spans into Sentry's native span model.
Deprecated: Prefer OTLP export via sentryotlp.NewTraceExporter. For collector-based setups, use the standard OTel exporter and register sentryotel.NewOtelIntegration for linking. Will be removed in 0.47.0.
Types ¶
type SentrySpanMap
deprecated
type SentrySpanMap struct {
// contains filtered or unexported fields
}
SentrySpanMap is a mapping between OpenTelemetry spans and Sentry spans. It stores spans per transaction for lookup by the propagator and event processor, and manages transaction entries for creating child spans via the shared spanRecorder.
Deprecated: Prefer OTLP export via sentryotlp.NewTraceExporter. Will be removed in 0.47.0 alongside NewSentrySpanProcessor.
func (*SentrySpanMap) Clear ¶
func (ssm *SentrySpanMap) Clear()
Clear removes all spans stored on the map.
func (*SentrySpanMap) Get ¶
func (ssm *SentrySpanMap) Get(traceID otelTrace.TraceID, spanID otelTrace.SpanID) (*sentry.Span, bool)
Get returns the current sentry.Span associated with the given OTel traceID and spanID.
func (*SentrySpanMap) GetTransaction ¶ added in v0.43.0
func (ssm *SentrySpanMap) GetTransaction(traceID otelTrace.TraceID) (*TransactionEntry, bool)
GetTransaction returns the transaction information for the given OTel traceID.
func (*SentrySpanMap) Len ¶
func (ssm *SentrySpanMap) Len() int
Len returns the number of spans on the map.
This should only be used in tests, since computing the map length is fairly expensive.
func (*SentrySpanMap) MarkFinished ¶ added in v0.35.2
func (ssm *SentrySpanMap) MarkFinished(spanID otelTrace.SpanID, traceID otelTrace.TraceID)
MarkFinished removes a span from the active set and decrements the transaction's active count. When the count reaches zero, the transaction entry is removed. The span ID is kept in knownSpanIDs so that HasSpan continues to work for child span creation.
func (*SentrySpanMap) Set ¶
func (ssm *SentrySpanMap) Set(spanID otelTrace.SpanID, span *sentry.Span, traceID otelTrace.TraceID)
Set stores the span and transaction information on the map. It handles both root and child spans automatically.
If there is a cache miss on the given traceID, a transaction entry is created. Subsequent calls for the same traceID just increment the active span count and store the span in the entry.
type TransactionEntry
deprecated
added in
v0.43.0
type TransactionEntry struct {
// contains filtered or unexported fields
}
TransactionEntry holds a reference to the root transaction span and tracks the number of active spans belonging to this trace.
Deprecated: Prefer OTLP export via sentryotlp.NewTraceExporter. Will be removed in 0.47.0 alongside NewSentrySpanProcessor.