mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[DOC] Update docs for anchored regex TraceQL queries (#97532)
* Update docs for anchored regex TraceQL queries * Add updates for Span Limit * Apply suggestions from code review * Updates from prettier
This commit is contained in:
parent
e002982cd7
commit
f276f9b35d
@ -79,10 +79,24 @@ To query a particular trace by its trace ID:
|
||||
|
||||
You can use the query editor’s autocomplete suggestions to write queries.
|
||||
The editor detects spansets to provide relevant autocomplete options.
|
||||
It uses regular expressions (regex) to detect where it is inside a spanset and provide attribute names, scopes, intrinsic names, logic operators, or attribute values from the Tempo API, depending on what's expected for the current situation.
|
||||
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 the Tempo API, depending on what's expected for the current situation.
|
||||
|
||||

|
||||
|
||||
### Anchored regular expressions
|
||||
|
||||
Regular expressions are anchored at both ends.
|
||||
This anchoring makes the queries faster and matches the behavior of PromQL, where regular expressions are also fully anchored.
|
||||
|
||||
An unanchored query, such as:
|
||||
`{ span.foo =~ "bar" }`
|
||||
is now treated as:
|
||||
`{ span.foo =~ "^bar$" }`.
|
||||
|
||||
If you use TraceQL with regular expressions in your Grafana dashboards and you want the unanchored behavior, update the queries to use the unanchored version, such as `{ span.foo =~ ".*bar.*"}`.
|
||||
|
||||
### Create a query with autocomplete
|
||||
|
||||
To create a query using autocomplete, follow these steps:
|
||||
|
||||
1. From the menu, choose **Explore**, select the desired Tempo data source, and navigate to the **TraceQL** tab.
|
||||
@ -116,6 +130,14 @@ For more information on span details, refer to [Traces in Explore](https://grafa
|
||||
|
||||

|
||||
|
||||
Querying spansets with a large number of spans can negatively impact performance.
|
||||
You can use the **Span Limit** field in **Options** section of the TraceQL query editor.
|
||||
This field sets the maximum number of spans to return for each span set.
|
||||
By default, the maximum value that you can set for the **Span Limit** value (or the spss query) is 100.
|
||||
In Tempo configuration, this value is controlled by the `max_spans_per_span_set` parameter and can be modified by your Tempo administrator.
|
||||
Grafana Cloud users can contact Grafana Support to request a change.
|
||||
Entering a value higher than the default results in an error.
|
||||
|
||||
### Focus on traces or spans
|
||||
|
||||
Under **Options**, you can choose to display the table as **Traces** or **Spans** focused.
|
||||
|
Loading…
Reference in New Issue
Block a user