Skip to content

Provide a way to inject baggage and sentry-trace headers to a request #1006

@OrkhanAlikhanov

Description

@OrkhanAlikhanov

Problem Statement

I have a CLI that makes request to our backend, and wanted to have distributed tracing setup. LLM suggested to use:

// Inject Sentry tracing headers
sentry.TraceRequest(tx.Context(), req)

But apparently such method does not exist. The closest thing I found was from otel package:

sentryotel.NewSentryPropagator().Inject(req.Context(), propagation.HeaderCarrier(req.Header))

Which I don't think will work as I don't have otel setup.

Solution Brainstorm

Add something like sentry.TraceRequest(tx.Context(), req) or sentry.GetTraceHeaders(tx.Context()) methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions