#Export traces
12 messages · Page 1 of 1 (latest)
Hi @glass thunder. I'm happy to dig into this for you! I'll check my internal sources for answers to your question! :wave:
There are a few related pieces here: exporting, querying, and using tags.
1. Exporting trace data
From the knowledge sources:
- Sentry currently has no API to export raw tracing data. [API export issue]
- There is a feature request to “Add an ‘Export All’ option to the Traces view” specifically because users lost the ability to export when the Discover Transactions dataset was deprecated; this is tracked but not available yet. [Traces export issue]
- CSV export is only available from Discover (Errors / Transactions datasets) for Business/Enterprise plans, not from the Trace Explorer UI. [CSV export help; Traces export issue]
So, based on the docs and issues provided, there is no supported way to bulk-export full traces or raw span data from the Trace Explorer or via a dedicated traces export API.
If you’re on Business/Enterprise, you can:
- Use Discover → Transactions (while still available) to export transaction-level rows as CSV and combine them externally, but this is explicitly marked as deprecated in favor of Explore / Traces and does not give you full span-level traces. [CSV export help; Traces export issue]
2. Querying traces (including by tags)
For querying inside Sentry:
- You can use the Trace Explorer (Explore → Traces) to search for traces that contain spans matching specific conditions. [Search traces changelog; Viewing trace data]
- The trace explorer lets you define conditions on up to 3 different spans within a trace (for example, “span A has user X”, “span B is a page load”, “span C is an HTTP call > 1s”). [Search traces changelog]
The knowledge sources do not explicitly document which span attributes/tags are queryable or how OTEL attributes map into the trace search syntax, so I can’t reliably describe exact query fields for your custom tags. I can only say that:
- Sentry can ingest OTLP traces and attributes from OpenTelemetry. [OTLP concepts]
- Those attributes are visible in the Trace View, but array attributes and span links are only partially supported for search/aggregation. [OTLP concepts]
The docs provided do not clearly state whether arbitrary OTEL attributes or custom tags are fully searchable in Trace Explorer, so I can’t confirm that you can reliably build a “customer journey” query purely by a custom tag.
3. Alternative: keep your own OTEL copy
The docs do show how to send OTLP traces to Sentry via OTEL exporters / collectors, while still allowing you to route the same data elsewhere (for example, to your own storage where you can build long-running “customer journey” analytics):
- Configure your OpenTelemetry SDK or Collector to export traces to Sentry’s OTLP endpoint using
x-sentry-authheaders. [OTLP concepts; OTEL Collector drain] - Because the Collector is vendor-agnostic, you can add multiple exporters (one to Sentry, one to your own backend) in the same pipeline; however, the exact multi-exporter setup is not shown in the snippets we have, so I can’t provide a concrete config example from these sources.
This pattern would let you:
- Use Sentry for interactive trace debugging and performance analysis.
- Use your own data store for long-duration “customer journey” reconstruction and custom analytics.
4. Summary for your use case
Based strictly on the provided sources:
- Direct export of full traces from Sentry (UI or API) is not supported today.
- You can search and filter traces in the Trace Explorer, including by span conditions, but the docs here don’t clearly guarantee full support for arbitrary custom/OTEL tags in queries.
- For a robust “customer journey” export, the documented path is to send OTEL traces to Sentry and another destination in parallel using OpenTelemetry (SDK or Collector), and build your journey analytics from that second destination. [OTLP concepts; OTEL Collector drain]
If you share which tags/attributes you’re using to identify a “customer journey” (for example, a session ID or user ID), I can help you map that to what’s documented about OTEL → Sentry ingestion and trace search in more detail, within the limits of the sources.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@glass thunder Our robots are still learning and improving, please let us know if this response was correct by reacting below.
@tight crypt We have traces coming from angular, browser/js and dotnet unfortunately and the frontend traces is what is missing (we have an otlp endpoint in the backend for the dotnet part).
Let me check the knowledge base for you again. One moment! :books:
You can get Angular/browser traces into the same OTLP-based traces you already have from .NET, but not by exporting OTLP directly from the browser. Instead, you use the Sentry JS SDK in the browser and let it propagate trace context to your OTLP-instrumented backend.
From the docs and issues in the sources:
-
Browser/Angular → Sentry tracing
For Angular, set up Sentry’s built‑in browser tracing:
import * as Sentry from "@sentry/angular"; Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [Sentry.browserTracingIntegration()], tracesSampleRate: 1.0, tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], });This will create pageload/navigation transactions and spans for XHR/fetch, and attach
sentry-traceandbaggageheaders to outgoing requests that matchtracePropagationTargets. [Angular tracing setup; Automatic instrumentation] -
Distributed tracing between Angular and .NET
With
browserTracingIntegrationandtracePropagationTargetsconfigured, the browser will automatically propagate Sentry’s trace headers to your backend. On the backend, the .NET Sentry SDK (or your OTEL setup if you’re using Sentry’s OTLP ingestion) will pick up those headers and continue the trace, giving you end‑to‑end traces across frontend and backend in Sentry. [Angular distributed tracing; Custom trace propagation]
If you also have OpenTelemetry in the backend, Sentry supports distributed tracing between Sentry‑instrumented frontends and OTEL‑instrumented services via trace propagation; you can use propagateTraceparent in the JS SDK when you need to bridge to W3C traceparent for OTEL. [OTLP distributed tracing]
-
OTLP ingestion (backend)
Since you already have an OTLP endpoint for .NET, make sure it’s configured to send traces to Sentry’s OTLP traces endpoint with the
x-sentry-authheader. [OTLP concepts; OTEL Collector integration]Example env vars for a direct OTEL exporter:
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="___OTLP_TRACES_URL___" export OTEL_EXPORTER_OTLP_TRACES_HEADERS="x-sentry-auth=sentry sentry_key=___PUBLIC_KEY___" ``` [[OTLP concepts](<https://docs.sentry.io/concepts/otlp/>)] -
What you cannot do from the browser
The knowledge sources explicitly say there are no plans to support OpenTelemetry in the browser directly; the supported pattern is to use the Sentry JS SDK in the browser and OTEL/OTLP on the backend. [JS OTEL browser issue; OTEL browser discussion]
So you cannot have the Angular/browser code export OTLP traces straight to your OTLP endpoint; instead, you:
- Use Sentry JS SDK in the browser.
- Let it propagate trace context to the backend.
- Let the backend’s OTEL exporter send the combined trace to Sentry’s OTLP endpoint.