mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[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:
parent
2a734a9e3f
commit
da8eb8faa5
@ -21,7 +21,7 @@ weight: 1150
|
||||
|
||||
# Grafana Pyroscope data source
|
||||
|
||||
Formerly Phlare data source, now Grafana Pyroscope, a horizontally scalable, highly-available, multi-tenant, OSS, continuous profiling aggregation system. Add it as a data source, and you are ready to query your profiles in [Explore][explore].
|
||||
Grafana Pyroscope is a horizontally scalable, highly available, multi-tenant, OSS, continuous profiling aggregation system. Add it as a data source, and you are ready to query your profiles in [Explore][explore].
|
||||
|
||||
## Configure the Grafana Pyroscope data source
|
||||
|
||||
@ -30,59 +30,78 @@ To configure basic settings for the data source, complete the following steps:
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Grafana Pyroscope` in the search bar.
|
||||
1. Click **Grafana Pyroscope**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
1. Click **Grafana Pyroscope** to display the **Settings** tab of the data source.
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Grafana Pyroscope or Phlare instance, e.g., `http://localhost:4100` |
|
||||
| `Basic Auth` | Enable basic authentication to the data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Minimal step` | Used for queries returning timeseries data. Phlare backend, similar to Prometheus, scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval. For Pyroscope backend this prevents returning too many data points to the front end. |
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Grafana Pyroscope instance, for example, `http://localhost:4100`. |
|
||||
| `Basic Auth` | Enable basic authentication to the data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Minimal step` | Used for queries returning timeseries data. The Pyroscope backend, similar to Prometheus, scrapes profiles at certain intervals. To prevent querying at smaller interval, use Minimal step same or higher than your Pyroscope scrape interval. This prevents returning too many data points to the frontend. |
|
||||
|
||||
### Traces to profiles
|
||||
|
||||
You can link profile and tracing data using your Pyroscope data source with the Tempo data source.
|
||||
For more information, refer to the [Traces to profile section][configure-tempo-data-source] of the Tempo data source documentation.
|
||||
|
||||
{{< youtube id="AG8VzfFMLxo" >}}
|
||||
|
||||
## Querying
|
||||
|
||||
### Query Editor
|
||||
You can query your profiling data using the query editor.
|
||||
|
||||

|
||||
### Query editor
|
||||
|
||||
Query editor gives you access to a profile type selector, a label selector, and collapsible options.
|
||||
The query editor gives you access to a profile type selector, a label selector, and collapsible options.
|
||||
|
||||

|
||||

|
||||
|
||||
Select a profile type from the drop-down menu. While the label selector can be left empty to query all profiles without filtering by labels, the profile type or app must be selected for the query to be valid. Grafana does not show any data if the profile type or app isn’t selected when a query is run.
|
||||
To access the query editor:
|
||||
|
||||

|
||||
1. Sign into Grafana or Grafana Cloud.
|
||||
1. Select your Pyroscope data source.
|
||||
1. From the menu, choose **Explore**.
|
||||
|
||||
Use the labels selector input to filter by labels. Pyroscope uses similar syntax to Prometheus to filter labels. Refer to [Pyroscope documentation](https://grafana.com/docs/pyroscope/latest/) for available operators and syntax.
|
||||
1. Select a profile type from the drop-down menu.
|
||||
|
||||

|
||||
{{< figure src="/media/docs/pyroscope/query-editor/select-profile.png" class="docs-image--no-shadow" max-width="450px" caption="Profile selector" >}}
|
||||
|
||||
Options section contains a switch for Query Type and Group by.
|
||||
1. Use the labels selector input to filter by labels. Pyroscope uses similar syntax to Prometheus to filter labels.
|
||||
Refer to [Pyroscope documentation](https://grafana.com/docs/pyroscope/latest/) for available operators and syntax.
|
||||
|
||||
Select a query type to return the profile data which can be shown in the [Flame Graph][flame-graph], metric data visualized in a graph, or both. You can only select both options in a dashboard, because panels allow only one visualization.
|
||||
While the label selector can be left empty to query all profiles without filtering by labels, the profile type or app must be selected for the query to be valid.
|
||||
|
||||
Group by allows you to group metric data by a specified label. Without any Group by label, metric data is aggregated over all the labels into single time series. You can use multiple labels to group by. Group by has only an effect on the metric data and does not change the profile data results.
|
||||
Grafana doesn't show any data if the profile type or app isn’t selected when a query runs.
|
||||
|
||||

|
||||
|
||||
1. Expand the **Options** section to view **Query Type** and **Group by**.
|
||||

|
||||
|
||||
1. Select a query type to return the profile data which can be shown in the [Flame Graph][flame-graph], metric data visualized in a graph, or both. You can only select both options in a dashboard, because panels allow only one visualization.
|
||||
|
||||
**Group by** allows you to group metric data by a specified label. Without any **Group by** label, metric data is aggregated over all the labels into single time series. You can use multiple labels to group by. Group by has only an effect on the metric data and doesn't change the profile data results.
|
||||
|
||||
### Profiles query results
|
||||
|
||||
Profiles can be visualized in a flame graph. See the [Flame Graph documentation][flame-graph] to learn about the visualization and its features.
|
||||
|
||||

|
||||

|
||||
|
||||
Pyroscope returns profiles aggregated over a selected time range, and the absolute values in the flame graph grow as the time range gets bigger while keeping the relative values meaningful. You can zoom in on the time range to get a higher granularity profile up to the point of a single scrape interval.
|
||||
Pyroscope returns profiles aggregated over a selected time range.
|
||||
The absolute values in the flame graph grow as the time range gets bigger while keeping the relative values meaningful.
|
||||
You can zoom in on the time range to get a higher granularity profile up to the point of a single scrape interval.
|
||||
|
||||
### Metrics query results
|
||||
|
||||
Metrics results represent the aggregated sum value over time of the selected profile type.
|
||||
|
||||

|
||||

|
||||
|
||||
This allows you to quickly see any spikes in the value of the scraped profiles and zoom in to a particular time range.
|
||||
|
||||
@ -90,7 +109,7 @@ This allows you to quickly see any spikes in the value of the scraped profiles a
|
||||
|
||||
You can modify the Grafana configuration files to provision the Grafana Pyroscope data source. To learn more, and to view the available provisioning settings, see [provisioning documentation][provisioning-data-sources].
|
||||
|
||||
Here is an example config:
|
||||
Here is an example configuration:
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@ -112,4 +131,7 @@ datasources:
|
||||
|
||||
[provisioning-data-sources]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#datasources"
|
||||
[provisioning-data-sources]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#datasources"
|
||||
|
||||
[configure-tempo-data-source]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/tempo/configure-tempo-data-source"
|
||||
[configure-tempo-data-source]: "/docs/grafana-cloud/ -> docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/configure-tempo-data-source"
|
||||
{{% /docs/reference %}}
|
||||
|
@ -26,6 +26,10 @@ For instructions on how to add a data source to Grafana, refer to the [administr
|
||||
Only users with the organization administrator role can add data sources.
|
||||
Administrators can also [configure the data source via YAML][configure-tempo-data-source] with Grafana's provisioning system.
|
||||
|
||||
This video explains how to add data sources, including Loki, Tempo, and Mimir, to Grafana and Grafana Cloud. Tempo data source set up starts at 4:58 in the video.
|
||||
|
||||
{{< youtube id="cqHO0oYW6Ic" start="298" >}}
|
||||
|
||||
Once you've added the data source, you can [configure it]({{< relref "./configure-tempo-data-source/" >}}) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor/" >}}) when they [build dashboards][build-dashboards] and use [Explore][explore].
|
||||
|
||||
{{< section withDescriptions="true">}}
|
||||
|
@ -35,7 +35,11 @@ To configure basic settings for the Tempo data source, complete the following st
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
|
||||
You can also configure settings specific to the Tempo data source. These options are described in the sections below.
|
||||
You can also configure settings specific to the Tempo data source.
|
||||
|
||||
This video explains how to add data sources, including Loki, Tempo, and Mimir, to Grafana and Grafana Cloud. Tempo data source set up starts at 4:58 in the video.
|
||||
|
||||
{{< youtube id="cqHO0oYW6Ic" start="298" >}}
|
||||
|
||||
## Trace to logs
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user