Skip to content

Commit

Permalink
Update trace explorer page (#11608)
Browse files Browse the repository at this point in the history
* Update trace explorer page

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

* Update docs/product/explore/traces/index.mdx

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>

---------

Co-authored-by: Alex Krawiec <alexanderkrawiec@gmail.com>
  • Loading branch information
lizokm and coolguyzone authored Oct 18, 2024
1 parent ff1ae48 commit 2c69355
Showing 1 changed file with 56 additions and 48 deletions.
104 changes: 56 additions & 48 deletions docs/product/explore/traces/index.mdx
Original file line number Diff line number Diff line change
@@ -1,85 +1,93 @@
---
title: "Trace Explorer"
sidebar_order: 30
description: "Learn how to use the Traces page to search span data, including conditions relating to the structure of the trace itself, and find distributed traces that help you get to the root cause of the problem."
description: "Learn how to use the Trace Explorer to search span data, find distributed traces, and debug performance issues across your entire application stack."
---

<Note>
The Traces page is currently in beta. Beta features are still in progress and may have bugs. We recognize the irony.
</Note>

The [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/traces/) page lets you search for individual spans that make up a trace, linked by a trace id. This gives you a connected view of your application from the frontend to the backend and/or between different applications and workflows. You can query and find particular distributed traces to help you debug problems or optimize hot paths in your application.
The [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/traces/) page allows you to query individual spans within traces and analyze distributed traces across your entire application stack. When you search by spans, your queries are more targeted and more precise. This helps you pinpoint specific operations that may be causing problems (like slow database queries, API calls, and so on) across multiple traces.

## Key Concepts
- **Trace**: A collection of spans representing the end-to-end journey of a request through your system that all share the same trace ID.
- **Distributed Trace**: A collection of spans representing the end-to-end journey of a request from your frontend to your backend that all share the same trace ID. (In order for this to work, you have to have Sentry SDKs instrumented for both your backend and your frontend.)
- **Span**: An individual unit of work within a trace, such as a database query or an API call.

### Build a New Traces Query
## How to Build a Span Query

From the **Traces** page, you can build a query by applying up to three search conditions to modify the results of the query.
To get started, go to the [Traces](https://sentry.io/orgredirect/organizations/:orgslug/traces/) page in Sentry. You'll be able to apply up to three types of span search conditions in the search bar. To see all available search conditions, click on the "all" tab once you start typing in your search. You'll be automatically prompted once you choose your search criteria. You'll also be able to filter by environment and date range.

All your search conditions should be targetting spans.
### Span Search Conditions

## Query Results
Each set of search conditions helps you find a specific kind of span within a trace. You can either:

![Page displaying search conditions for a trace and results of that search.](./img/traces-results.png)
- Use a single set of conditions to search across all spans.
**Example:** Single condition: Find traces where a user with email `ztv@example.com` loaded a specific frontend route:
![Exampe of search with one span conditions set](./img/traces-one-span-conditions-example.png)

Each row in the results represents a trace, with the first row of the table auto expanded to help interpret results while searching.
- Use multiple sets of conditions to search for traces containing all specified span types.
**Example:** Multiple conditions: Find traces where a user with the email `ztv@example.com` loaded a page on your frontend on a specific route AND a slow database query was present:
![Example of search with multiple span conditions](./img/traces-multiple-span-conditions-example.png)

For each of the top-level trace rows in the table we display:
- A trace id, which links out to the trace in question if you want to see the trace with the [Trace View](/concepts/key-terms/tracing/trace-view/).
- The project for the traces
- A trace name derived from either the root transaction or the first transaction if the trace doesn't have a consistent root transaction
- The number of spans matching your search conditions for that trace, versus the total number of spans inside that trace
- An approximate timeline of significant spans inside of the trace to help visually interpret span start and end times
- A duration, which is derived from the beginning of the first span to the end of the last span in a trace
- The relative time for when the trace happened, which also contains the exact time on hover
- A link to any issues associated to this trace
Because traces range accross multiple projects, there's no project filter, but you can filter by projects with similar sets of span conditions by adding `project:your-project-here` in the search.

Within each trace, we also return some of your matching spans to help you interpret your search conditions.
In this span table within each trace we display:
- A span id, which links to the [Trace View](/concepts/key-terms/tracing/trace-view/)
- A span description, which includes the project, `span.op` and `span.description` to help you identify the span
- The timeline of the span, which you can use with the trace timeline above to get an idea for when and where in the trace the span happened
- The duration of the span
- The relative time of when the span happened
### Search Syntax

## How to Search Traces
The Query Builder uses [Sentry's standard search syntax](/concepts/search/). Here are a few key points to keep in mind:

- Use built-in [span properties](/concepts/search/searchable-properties/spans/) or custom tags.
- Combine conditions with `AND` and `OR` (with some limitations on aggregates).
- Use functions like `count()` for advanced queries.

For a list of built-in key fields used in Sentry, check out our [Searchable Properties for Spans documentation](/concepts/search/searchable-properties/spans/).

<Note>

Trace Explorer uses sampled data. Your search results may be limited based on sampling rates and retention policies. Learn more about [retention priorities](/product/performance/retention-priorities/).

</Note>

## Search Query Results

![Trace Explorer results](./img/traces-results.png)

Search results are displayed as a list of traces. Each row corresponds to a single trace and has the below fields:

- **Trace ID**: Links to the detailed [Trace View](/concepts/key-terms/tracing/trace-view/).
- **Project**: The associated Sentry project.
- **Trace Name**: Derived from the root transaction or first transaction.
- **Matching Spans**: The number of spans matching your query versus the total spans in the trace.
- **Timeline**: A visual representation of significant spans within the trace.
- **Duration**: The total time from the first to last span.
- **Timestamp**: When the trace occurred (hover for exact time).
- **Issues**: Links to any associated error issues.

### Span Details

Expand a trace to see the matching spans in the following table format:

- **Span ID**: Links to the span in the Trace View.
- **Description**: Includes project, `span.op`, and `span.description`.
- **Timeline**: A visual representation of the span's position within the trace.
- **Duration**: The time taken by the individual span.
- **Timestamp**: When the span occurred.

Trace explorer allows you to search for up to 3 span conditions within a trace. Each set of span conditions matches against a particular span in a trace.

Adding one set of span conditions lets you search all spans.

The following example shows you all traces where:
- A user with the email `foo@example.com` loaded a page on your frontend on a specific route

![View of trace explorer with one span conditions set](./img/traces-one-span-conditions-example.png)

Alternatively, adding multiple span conditions will only return traces that contain ALL span conditions.

The following example let's you find a trace where:
- A user with the email `foo@example.com` loaded a page on your frontend on a specific route
- AND within that same trace, there was a slow database span

![View of trace explorer with multple span conditions set](./img/traces-multiple-span-conditions-example.png)

### Filter by Environment, and Date Range

These common filters allow you to filter on your environments, as well as specify the date range you want to zoom in on.

Since traces are distributed in nature, there is no page-wide project filter, but you can filter on projects per set of span conditions by adding `project:your-project-here` in the search.

### Filter by Search Conditions

<Note>

When performing searches on spans, based on your search criteria
and sample rate, the events available may be limited because Traces uses
sampled data only. Learn more by reading about [our retention priorities](/product/performance/retention-priorities/).

</Note>

All events have built-in key fields or custom tags, this includes our span data. Use the search bar to enter these keys and assign them values. This will filter down your list of events. For a list of the built-in key fields, check out our [Searchable Properties for spans documentation](/concepts/search/searchable-properties/spans/).

### Syntax

The Query Builder syntax is identical to [Sentry's Search syntax](/concepts/search/). After you enter a key field from above or a custom tag, you can use any of the referenced syntax. For example, `count()` gives you the number of times an event occurs.

Use `OR` and `AND` to search conditions between filters. However `OR` cannot be used between aggregate and non-aggregate filters. For more details about these conditions, see [Using `OR` and `AND`](/concepts/search/#using-or-and-and).

0 comments on commit 2c69355

Please sign in to comment.