[DOC] Fix style issues and add videos to tracing and profiling shared files (#81215)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Ryan Perry <Rperry2174@gmail.com> Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
This commit is contained in:
co-authored by
Jack Baldry
Ryan Perry
Clayton Cornell
parent
2a734a9e3f
commit
da8eb8faa5
@@ -25,7 +25,7 @@ To learn more about how to query by TraceQL, refer to the [TraceQL documentation
|
||||
|
||||
The TraceQL query editor, located on the **Explore** > **TraceQL** tab in Grafana, lets you search by trace ID and write TraceQL queries using autocomplete.
|
||||
|
||||

|
||||

|
||||
|
||||
## Enable the query editor
|
||||
|
||||
@@ -58,7 +58,7 @@ To query a particular trace by its trace ID:
|
||||
1. Enter the trace ID into the query field. For example: `41928b92edf1cdbe0ba6594baee5ae9`
|
||||
1. Click **Run query** or use the keyboard shortcut Shift + Enter.
|
||||
|
||||

|
||||

|
||||
|
||||
## Use autocomplete to write queries
|
||||
|
||||
@@ -66,27 +66,29 @@ You can use the query editor’s autocomplete suggestions to write queries.
|
||||
The editor detects span sets to provide relevant autocomplete options.
|
||||
It uses regular expressions (regex) to detect where it's inside a spanset and provide attribute names, scopes, intrinsic names, logic operators, or attribute values from Tempo's API, depending on what's expected for the current situation.
|
||||
|
||||

|
||||

|
||||
|
||||
To create a query using autocomplete, follow these steps:
|
||||
|
||||
1. Use the steps above to access the query editor and begin your query.
|
||||
1. From the menu, choose **Explore**, select the desired Tempo data source, and navigate to the **TraceQL** tab.
|
||||
|
||||
1. Enter your query. As you type your query, autocomplete suggestions appear as a drop-down. Each letter you enter refines the autocomplete options to match.
|
||||
|
||||
1. Use your mouse or arrow keys to select any option you wish. When the desired option is highlighted, press Tab on your keyboard to add the selection to your query.
|
||||
|
||||
1. Once your query is complete, select **Run query** to perform the query.
|
||||
1. Once your query is complete, select **Run query**.
|
||||
|
||||
## View query results
|
||||
|
||||
Query results for both the editor and the builder are returned in a table. Selecting the Trace ID or Span ID provides more detailed information.
|
||||
|
||||

|
||||
Selecting the trace ID from the returned results opens a trace diagram. Selecting a span from the returned results opens a trace diagram and reveals the relevant span in the trace diagram (the highlighted blue line).
|
||||
|
||||
Selecting the trace ID from the returned results opens a trace diagram. Selecting a span from the returned results opens a trace diagram and reveals the relevant span in the trace diagram (above, the highlighted blue line).
|
||||
In the trace diagram, the bold text on the left side of each span indicates the service name, for example `mythical-requester: requester`, and it is hidden when subsequent spans have the same service name (nested spans).
|
||||
Each service has a color assigned to it, which is visible to the left of the name and timeline in the graph.
|
||||
Spans with the same color belong to the same service. The grey text to the right of the service name indicates the span name.
|
||||
|
||||
In the trace diagram, the bold text on the left side of each span indicates the service name, for example `mythical-requester: requester`, and it is hidden when subsequent spans have the same service name (nested spans). Each service has a color assigned to it, which is visible to the left of the name and timeline in the graph. Spans with the same color belong to the same service. The grey text to the right of the service name indicates the span name.
|
||||

|
||||
|
||||
### Streaming results
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ labels:
|
||||
|
||||
The TraceQL query builder, located on the **Explore** > **Query type** > **Search** in Grafana, provides drop-downs and text fields to help you write a query.
|
||||
|
||||

|
||||

|
||||
|
||||
The builder lets you run the most common queries in as few clicks as possible. You don't need to know the underlying query language or database architecture to use it.
|
||||
|
||||
@@ -32,14 +32,14 @@ You can use the query builder to search trace data by resource service name, spa
|
||||
|
||||
In addition, you can add query builder blocks, view the query history, and use the **Inspector** to see details.
|
||||
|
||||
{{< figure src="/static/img/docs/queries/screenshot-tempods-query-search.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo Search query type" >}}
|
||||
{{< figure src="/media/docs/tempo/traceql/screenshot-tempods-query-search.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo Search query type" >}}
|
||||
|
||||
## Perform a search
|
||||
|
||||
To perform a search, you need to select filters and/or tags and then run the query. The results appear underneath the query builder.
|
||||
The screenshot below identifies the areas used to perform a search.
|
||||
The screenshot identifies the areas used to perform a search.
|
||||
|
||||
{{< figure src="/static/img/docs/queries/screenshot-tempods-query-search-parts.png" class="docs-image--no-shadow" max-width="750px" caption="Parts of Tempo Search query type" >}}
|
||||
{{< figure src="/media/docs/tempo/traceql/screenshot-tempods-query-search-parts.png" class="docs-image--no-shadow" max-width="750px" caption="Parts of Tempo Search query type" >}}
|
||||
|
||||
| Number | Name | Action | Comment |
|
||||
| :----- | :----------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -109,8 +109,11 @@ To add a tag, follow these steps:
|
||||
Using **Aggregate by**, you can calculate RED metrics (total span count, percent erroring spans, and latency information) for spans of `kind=server` that match your filter criteria, grouped by one or more attributes.
|
||||
This capability is based on the [metrics summary API](/docs/grafana-cloud/monitor-infrastructure/traces/metrics-summary-api/).
|
||||
Metrics summary only calculates summaries based on spans received within the last hour.
|
||||
For additional information, refer to [Traces to metrics: Ad-hoc RED metrics in Grafana Tempo with `Aggregate by`](https://grafana.com/blog/2023/12/07/traces-to-metrics-ad-hoc-red-metrics-in-grafana-tempo-with-aggregate-by/).
|
||||
|
||||
{{< youtube id="g97CjKOZqT4" >}}
|
||||
<!--Impromptu RED metrics with Aggregate by -->
|
||||
|
||||
{{< youtube id="xOolCpm2F8c" >}}
|
||||
|
||||
When you use **Aggregate by**, the selections you make determine how the information is reported in the Table. Every combination that matches selections in your data is listed in the table.
|
||||
Each aggregate value, for example `intrinsic`:`name`, has a corresponding column in the results table.
|
||||
@@ -119,13 +122,13 @@ For example, **names** matching `GET /:endpoint` with a **span.http.user_agent**
|
||||
|
||||
The RED metrics are calculated for every name and user agent combination found in your data.
|
||||
|
||||

|
||||
|
||||
The screenshot shows all of the successful HTTP `status_code` API calls against the `mystical-server` service.
|
||||
The results are shown in the same order used in **Aggregate by**.
|
||||
For example, **Aggregate by** lists `intrinsic.name` followed by `span.http.user_agent`.
|
||||
The first column in the results Table shows **name** and then **span.http.user_agent**.
|
||||
|
||||

|
||||
|
||||
To use this capability:
|
||||
|
||||
1. In the **Aggregate by** row, select a scope from the first drop-down box. For example, `span`.
|
||||
@@ -134,6 +137,10 @@ To use this capability:
|
||||
1. Optional: Select a **Time range** to expand or narrow the data set for an hour's range.
|
||||
1. Select **Run query**.
|
||||
|
||||
<!-- Explanation of how to use feature -->
|
||||
|
||||
{{< youtube id="g97CjKOZqT4" >}}
|
||||
|
||||
### Optional: Add queries
|
||||
|
||||
Using **Add query**, you can have successive queries that run in sequential order.
|
||||
@@ -147,7 +154,7 @@ Select **Run query** to run the TraceQL query (1 in the screenshot).
|
||||
|
||||
Queries can take a little while to return results. The results appear in a table underneath the query builder. Selecting a Trace ID (2 in the screenshot) displays more detailed information (3 in the screenshot).
|
||||
|
||||
{{< figure src="/static/img/docs/queries/screenshot-tempods-query-results.png" class="docs-image--no-shadow" max-width="750px" caption="Tempo Search query type results" >}}
|
||||
{{< figure src="/media/docs/tempo/traceql/screenshot-tempods-query-results.png" class="docs-image--no-shadow" max-width="750px" caption="Tempo Search query type results" >}}
|
||||
|
||||
#### Streaming results
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ Using Trace to profiles, you can use Grafana’s ability to correlate different
|
||||
**Trace to profiles** lets you link your Grafana Pyroscope data source to tracing data.
|
||||
When configured, this connection lets you run queries from a trace span into the profile data.
|
||||
|
||||
{{< youtube id="AG8VzfFMLxo" >}}
|
||||
|
||||
There are two ways to configure the trace to profiles feature:
|
||||
|
||||
- Use a simplified configuration with default query, or
|
||||
@@ -28,39 +30,43 @@ There are two ways to configure the trace to profiles feature:
|
||||
|
||||
To use trace to profiles, navigate to **Explore** and query a trace. Each span now links to your queries. Clicking a link runs the query in a split panel. If tags are configured, Grafana dynamically inserts the span attribute values into the query. The query runs over the time range of the (span start time - 60) to (span end time + 60 seconds).
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/profiles/tempo-trace-to-profile.png" max-width="900px" class="docs-image--no-shadow" alt="Selecting a link in the span queries the profile data source" >}}
|
||||

|
||||
|
||||
To use trace to profiles, you must have a configured Grafana Pyroscope data source. For more information, refer to the [Grafana Pyroscope data source documentation](/docs/grafana/latest/datasources/grafana-pyroscope/).
|
||||
To use trace to profiles, you must have a configured Grafana Pyroscope data source. For more information, refer to the [Grafana Pyroscope data source](/docs/grafana/latest/datasources/grafana-pyroscope/) documentation.
|
||||
|
||||
**Embedded flame graphs** are also inserted into each span details section that has a linked profile (requires a configured Grafana Pyroscope data source). This lets you see resource consumption in a flame graph visualization for each span without having to navigate away from the current view. Hover over a particular block in the flame graph to see more details about the resources being consumed.
|
||||
**Embedded flame graphs** are also inserted into each span details section that has a linked profile (requires a configured Grafana Pyroscope data source).
|
||||
This lets you see resource consumption in a flame graph visualization for each span without having to navigate away from the current view.
|
||||
Hover over a particular block in the flame graph to see more details about the resources being consumed.
|
||||
|
||||
If you have configured a Pyroscope data source and no profile data is available or the Profiles for this span button & embedded flame graph is not visible, verify that the pyroscope.profile.id key-value pair exists in your span tags.
|
||||
|
||||
## Simple configuration
|
||||
## Use a basic configuration
|
||||
|
||||
To use a simple configuration, follow these steps:
|
||||
|
||||
1. Select a Pyroscope data source from the **Data source** drop-down.
|
||||
1. Optional: Choose any tags to use in the query. If left blank, the default values of `service.name` and `service.namespace` are used.
|
||||
|
||||
The tags you configure must be present in the spans attributes or resources for a trace to profiles span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source doesn't allow using dots in labels. In that case you can for example remap `service.name` to `service_name`.
|
||||
The tags you configure must be present in the spans attributes or resources for a trace-to-profiles span link to appear.
|
||||
|
||||
You can optionally configure a new name for the tag. This is useful if the tag has dots in the name and the target data source doesn't allow dots in labels. In that case, you can remap `service.name` to `service_name`.
|
||||
|
||||
1. Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.
|
||||
|
||||
The profile type or app must be selected for the query to be valid. Grafana doesn't show any data if the profile type or app isn’t selected when a query runs.
|
||||

|
||||

|
||||
|
||||
1. Do not select **Use custom query**.
|
||||
1. Select **Save and Test**.
|
||||
|
||||
## Custom query
|
||||
If you have configured a Pyroscope data source and no profile data is available or the **Profiles for this span** button and the embedded flame graph is not visible, verify that the `pyroscope.profile.id` key-value pair exists in your span tags.
|
||||
|
||||
## Configure a custom query
|
||||
|
||||
To use a custom query with the configuration, follow these steps:
|
||||
|
||||
1. Select a Pyroscope data source from the **Data source** drop-down.
|
||||
1. Optional: Choose any tags that will be used in the query. If left blank, the default values of `service.name` and `service.namespace` are used.
|
||||
1. Optional: Choose any tags to use in the query. If left blank, the default values of `service.name` and `service.namespace` are used.
|
||||
|
||||
These tags can be used in the custom query with `${__tags}` variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren’t present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn't allow using dots in labels. For example, you can remap `service.name` to `service_name` in such a case. If you don’t map any tags here, you can still use any tag in the query like this `method="${__span.tags.method}"`.
|
||||
These tags can be used in the custom query with `${__tags}` variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source. Only the tags that were present in the span are included; tags that aren't present are omitted. You can also configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn't allow using dots in labels. For example, you can remap `service.name` to `service_name`. If you don’t map any tags here, you can still use any tag in the query, for example: `method="${__span.tags.method}"`.
|
||||
|
||||
1. Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.
|
||||
1. Switch on **Use custom query** to enter a custom query.
|
||||
|
||||
Reference in New Issue
Block a user