Thread Usage

Visualizes the relationship between classes and threads, showing which classes use which threads and how frequently (indicated by edge thickness). This is useful for identifying patterns, bottlenecks, or resource allocation in multi-threaded applications.

Visualization: in this scenario, the widget visualizes which classes use which threads in a service. The left side shows different class values appearing as source nodes. The right side shows different thread values appearing as target nodes. Lines flow from each class to each thread: thicker lines indicate more occurrences of that class-thread combination.

Sankey diagram showing a use case of Thread Usage

Figure 231. Thread Usage


Sample input data:

actionclassthreadtimestamp
processRequestUserServicehttp-worker-12025-08-11T00:01:23Z
queryDatabaseConnectordb-pool-12025-08-11T00:01:24Z
processRequestUserServicehttp-worker-22025-08-11T00:01:25Z
updateCacheManagercache-worker2025-08-11T00:01:26Z
updateDatabaseConnectordb-pool-22025-08-11T00:01:27Z

Query. This query prepares the data structure and produces the input data manually instead of calling the companion sankey() function. The output can be directly used with the diagram, which will render the visualization based on the source, target, and weight fields.

logscale
rename(class, as=source) 
| rename(thread, as=target) 
| groupBy([source, target], function=count(as=weight))

Query breakdown:

  1. Renames the class field to source to create the source nodes (left side of diagram)

  2. Renames thread field to target to create the target nodes (right side of diagram).

  3. Groups by each unique class-thread combination and counts occurrences of each; the weight field determines edge thickness in the diagram.

The class and thread fields must be renamed as source and target to match the expected input. To produce weight fields, make sure that the function used in groupBy() names its result as weight.

Configuration:

  1. From the Search page, type your query in the Query Editor → click Run

  2. Choose Sankey in the Widget selector

  3. Click the style icon : this opens the Format panel on the side where some properties are already configured by default based on the query result.

  4. Modify some properties, such as:

  5. Change the Colors palette from inherit to custom to differentiate the widget from any others in this dashboard.

  6. Set Stack sorting as label to show the series sorted by label name.

  7. Adjust the Max length of the labels as desired (useful in case of long label text).

You can further customize this widget by setting more properties, see Sankey Property Reference.