mirror of
https://github.com/hanzoai/traces.git
synced 2026-11-03 04:05:45 +00:00
* Migrate changes from Tempo PR Signed-off-by: Jack Baldry <[email protected]> * Updates to resolve conflicts * Move getting started files * Fix aliases * Merge remote-tracking branch 'origin/master' into jdb/2025-07-tempo-set-up-restructure Signed-off-by: Jack Baldry <[email protected]> * Discard changes to content/docs/tempo/next/sync.json * Add aliases Signed-off-by: Jack Baldry <[email protected]> * Fix some aliases Signed-off-by: Jack Baldry <[email protected]> * Updates from rebase * Apply suggestions from code review Co-authored-by: Jack Baldry <[email protected]> * Apply suggestions from code review Co-authored-by: Jack Baldry <[email protected]> * Update content/docs/tempo/next/set-up-for-tracing/instrument-send/set-up-collector/tail-sampling/policies-strategies.md Co-authored-by: Jack Baldry <[email protected]> * Fix links on tile page and test page * Fix links and update missing content * Fix links * Fix links * Fix links and collector text * Updates from Alex's feedback * Link fixes * Fix links in deploy * Fix links * More link fixes * Fix yet more links * Fix more links * Apply suggestions from code review Co-authored-by: Jack Baldry <[email protected]> * Update content/docs/tempo/next/set-up-for-tracing/setup-tempo/test/set-up-test-app.md * Update content/docs/tempo/next/set-up-for-tracing/setup-tempo/test/set-up-test-app.md * Apply suggestions from code review * Add deploy preview workflow Signed-off-by: Jack Baldry <[email protected]> * Updates for Tiffany's suggested edits * Update manifest according to PR instructions --------- Signed-off-by: Jack Baldry <[email protected]> Co-authored-by: Kim Nylander <[email protected]>
3.4 KiB
3.4 KiB
title, menuTitle, description, aliases, weight
| title | menuTitle | description | aliases | weight | |
|---|---|---|---|---|---|
| Create custom service graphs | Create custom service graphs | Build your own service graphs using the Node Graph visualization from metrics generated by Tempo. |
|
300 |
Create custom service graphs
You can craft custom service graphs based on the metrics generated from metrics-generator.
Before you begin
For custom service graphs, you'll use:
- Tempo metrics-generator
- Grafana deployment of version v10 or higher
- Grafana Node graph panel
The metrics-generator creates multiple metrics, including traces_service_graph_request_total. This metric holds:
- relationships between services
- total number of requests performed between services
Create one or more Grafana dashboards
- In Grafana, create a new dashboard.
- Add two variables:
Add a panel
- Create a panel with a single query called
edges. - Select your Prometheus data source with metrics from the metrics-generator.
- Query using the following example:
label_join( label_join( label_join( sum(increase(traces_service_graph_request_total{server=~"$service"}[5m])) by (server, client) > 0 or sum(increase(traces_service_graph_request_total{client=~"$service"}[5m])) by (server, client) > 0, "source", "", "client"), "target", "", "server"), "id", "-", "server", "client") - Use Instant query type.
- If you encounter issues, switch to the Table data visualization. Refer to the Node graph panel documentation for more options and expected data shape.
All data transformations are done with the Prometheus label_join operators.
Explanation of the query:
- The first
label_joincreates a new fieldidwhich is required by the Node graph panel. - The second and third
label_joincopy the client and server labels to source and target respectively, as these names are also required by Node graph panel. traces_service_graph_request_totalis queried twice with theORoperator to get a combination of requests from and to all of the selected services.
This query gets most of the job done. However, it's limitations can't be compensated for even using the Grafana transform data feature. These limitations include:
- Unable to add request stats to nodes and edges, such as req/sec and error rates
- Unable to add custom icons for nodes
These limitations can be overcome by wrapping the Prometheus query into a REST API, which provides more flexibility with query results data transformations. You can use Grafana Infinity data source to visualize data from REST API.

