Traces: APM table (#48654)

* APM table

* Remove unnecessary changes in Explore.tsx

* Enhancements

* Show empty table if filter returns no results for table

* Error checking

* Combine extra filter options

* Convert service map query to apm query for apm requests

* Simplify links

* Better query building

* Extract method and clean up

* Upgrade filter

* Self review

* Export method

* Update test

* Switch area-chart to lcd-gauge

* Remove AreaChartCell

* Colors, units and other UI upgrades

* Remove 2 queries and reuse existing queries

* Nested observables

* rate/error rate/duration links: open new pane with range query and exemplars turned on

* Align error rate values to rate values col according to span_name

* Rearrange code

* Several improvements

* Filter by span_name

* align the table col values to the same row name (rateName) across the table

* On click tempo link filter by span_name

* Filtering updates

* Ensure serviceQuery null is ok

* Update link expr

* Update duration p90 unit

* Tempo links case

* Update tests

* Self review

* Tests

* Empty state

* Remove some code

* Test: should build expr correctly

* Test: should build link expr correctly

* Test: should get rate aligned values correctly

* Test: should make apm request correctly

* Test: should make tempo link correctly

* Move apm table tests to its own describe

* Feature toggle

* Added to docs for APM table

* Add screenshot to APM table section in docs

* Add feature toggle to test

* Split queries and make method names clearer

* Doc changes

* Add back in config import removed by merge

* Update tempo link and tests

* Update filter

* Set field filterable: false

* Updated doc

* Remove @end from queries

* Add back in tempo link
This commit is contained in:
Joey Tawadrous
2022-06-09 17:56:15 +01:00
committed by GitHub
parent e046f14f36
commit 4ed7ff2ed1
11 changed files with 683 additions and 61 deletions

View File

@@ -174,10 +174,10 @@ To display the service graph:
- [Configure the Grafana Agent](https://grafana.com/docs/tempo/next/grafana-agent/service-graphs/#quickstart) to generate service graph data
- Link a Prometheus datasource in the Tempo datasource settings.
- Navigate to [Explore]({{< relref "../explore/" >}})
- Select the Tempo datasource
- Select the **Service Graph** query type and run the query
- Optionally, filter by service name
- Navigate to [Explore]({{< relref "../explore/" >}}).
- Select the Tempo datasource.
- Select the **Service Graph** query type and run the query.
- (Optional): filter by service name.
You can pan and zoom the view with buttons or you mouse. For details about the visualization, refer to [Node graph panel](https://grafana.com/docs/grafana/latest/panels/visualizations/node-graph/).
@@ -192,6 +192,25 @@ The color of each circle represents the percentage of requests in each of the fo
Click on the service to see a context menu with additional links for quick navigation to other relevant information.
## APM table
The APM (Application Performance Management) table allows you to view several APM metrics out of the box.
To display the APM table:
1. Activate the tempoApmTable feature flag in your ini file.
1. Link a Prometheus datasource in the Tempo datasource settings.
1. Navigate to [Explore]({{< relref "../explore/_index.md" >}}).
1. Select the Tempo datasource.
1. Select the **Service Graph** query type and run the query.
1. (Optional): filter your results.
Note: The metric traces_spanmetrics_calls_total is used to display the name, rate & error rate columns and traces_spanmetrics_duration_seconds_bucket is used to display the duration column (these metrics will need to exist in your Prometheus datasource).
Click a row in the rate, error rate, or duration columns to open a query in Prometheus with the span name of that row automatically set in the query. Click a row in the links column to open a query in Tempo with the span name of that row automatically set in the query.
{{< figure src="/static/img/docs/tempo/apm-table.png" class="docs-image--no-shadow" max-width="500px" caption="Screenshot of the Tempo APM table" >}}
## Linking Trace ID from logs
You can link to Tempo trace from logs in Loki or Elastic by configuring an internal link. See the [Derived fields]({{< relref "loki/#derived-fields" >}}) section in the [Loki data source]({{< relref "loki/" >}}) or [Data links]({{< relref "elasticsearch/#data-links" >}}) section in the [Elastic data source]({{< relref "elasticsearch/" >}}) for configuration instructions.