mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
Tempo: Trace to metrics docs (#81548)
* Trace to metrics docs and share variables that can be used in query section * Update text * Add span start/end * Update docs/sources/shared/datasources/tempo-traces-to-profiles.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/tempo/configure-tempo-data-source.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/datasources/tempo/configure-tempo-data-source.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update text * Update docs/sources/datasources/tempo/configure-tempo-data-source.md --------- Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
This commit is contained in:
@ -66,29 +66,13 @@ 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 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. 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}"`.
|
||||
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}"`. You can learn more about custom query variables [here](/docs/grafana/latest/datasources/tempo/configure-tempo-data-source/#custom-query-variables).
|
||||
|
||||
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.
|
||||
1. Specify a custom query to be used to query profile data. You can use various variables to make that query relevant for current span. The link is shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query. You can interpolate the configured tags using the `$__tags` keyword.
|
||||
1. Select **Save and Test**.
|
||||
|
||||
## Custom query variables
|
||||
|
||||
To use a variable you need to wrap it in `${}`. For example, `${__span.name}`.
|
||||
|
||||
| Variable name | Description |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **\_\_tags** | This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful. |
|
||||
| **\_\_span.spanId** | The ID of the span. |
|
||||
| **\_\_span.traceId** | The ID of the trace. |
|
||||
| **\_\_span.duration** | The duration of the span. |
|
||||
| **\_\_span.name** | Name of the span. |
|
||||
| **\_\_span.tags** | Namespace for the tags in the span. To access a specific tag named `version`, you would use `${__span.tags.version}`. In case the tag contains dot, you have to access it as `${__span.tags["http.status"]}`. |
|
||||
| **\_\_trace.traceId** | The ID of the trace. |
|
||||
| **\_\_trace.duration** | The duration of the trace. |
|
||||
| **\_\_trace.name** | The name of the trace. |
|
||||
|
||||
## Configure trace to profiles
|
||||
|
||||
The following table describes options for configuring your trace to profiles settings:
|
||||
|
Reference in New Issue
Block a user