Configure a chart widget
Create custom chart widgets and include them in your dashboards and reports.
Create a widget
To add a new widget to your dashboard or report:
-
In the top toolbar, click New widget and select Chart.
-
(Optional) Change the chart title.
The default chart title is based on the Y-axis series.
-
Configure the X and Y axes.
-
(Optional) To make each graph represents the mean of a run group, toggle Average grouped runs.
-
Save your changes.
Configure the X axis
You can specify the following X-axis options in your chart:
-
In Series, define the input values. You can choose from the following:
- step, relative time, or absolute time
- one of the logged metrics
- custom expression
-
In Axis control, set the axis range and choose between linear and logarithmic scale.
Configure the Y axis
You can specify the following Y-axis options in your chart:
-
In Series, select the metrics to display on the chart. The following options are available:
- search for the logged metrics and check the ones to display,
- use a regular expression,
- build a custom expression.
-
In Axis control, set the axis range and choose between linear and logarithmic scale.
Neptune Scale distributes axis points evenly, even when the scaling is non-linear.
Compare multiple metrics on one chart
To display several metrics on one chart widget:
-
In a dashboard or report, add a new chart widget or edit an existing one.
-
In Y-axis → Series, select at least two metrics or custom expressions.
You can combine metrics with custom expressions.
-
Configure other options as needed and save your changes.
Create multiple charts at once
To create a separate chart for every selected metric:
-
In a dashboard or report, add a new chart widget or edit an existing one.
-
In Y-axis → Series, select at least two metrics.
-
In Single or multi-chart, select Create a chart for each Y-axis.
Once you save your changes, multiple widgets are created, one for every selected metric.
Custom Y or X expressions
In dashboards and reports, you can build mathematical expressions of logged metadata. A single expression can consist of several attribute names and operations.
Using expressions lets you calculate and display derivative metrics after the data is logged. For example, a weighted average of five separate metrics.
Create a custom expression
To create a custom expression:
-
In a dashboard or report, create or edit a chart widget.
-
In Series, select Use custom expression.
-
Name your expression.
-
In the input box, type
${
and select an attribute from the drop-down menu. To complete the expression:-
Use at least one supported operator
-
(Optional) Add more attributes, using the following syntax for each attribute:
${AttributeName}
-
-
Save your changes. The expression is applied automatically.
When hovering over the resulting graph, the legend shows the name of the expression in the Metric column.
Supported operators
For detailed descriptions of the supported functions, see ClickHouse SQL Reference.
See all supported functions
-
Operators
Operator Syntax Example Addition +
${metric1} + ${metric2}
Subtraction -
${metric1} - ${metric2}
Multiplication *
${metric1} * ${metric2}
Division /
${metric1} / ${metric2}
-
Arithmitic functions
Function Description negate()
Negates the value of an argument. abs()
Calculates the absolute value of an argument. -
Mathematical functions
e()
pi()
exp()
exp2()
exp10()
intExp2()
intExp10()
log()
log2()
log10()
lgamma()
tgamma()
cbrt()
sqrt()
sin()
sinh()
cos()
cosh()
tan()
tanh()
asin()
asinh()
acos()
acosh()
atan()
atanh()
erf()
erfc()
sign()
sigmoid()
degrees()
radians()
factorial()
-
Rounding functions
Function Description floor()
Returns the largest rounded number less than or equal to an argument. ceil()
Like floor()
but returns the smallest rounded number greater than or equal to an argument.trunc()
Like floor()
but returns the rounded number with largest absolute value that has an absolute value less than or equal to the arguments.round()
Rounds a value to a specified number of decimal places. roundToExp2()
Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to the nearest (whole non-negative) degree of two. roundDuration()
Accepts a number. If the number is less than one, it returns 0. Otherwise, it rounds the number down to numbers from the set of commonly used durations. -
Functions for generating random numbers
Function Returned value rand()
A random UInt32 number with uniform distribution. rand64()
A random UInt64 integer (UInt64) number. randCanonical()
A random Float64 number.
Example expressions
(${metric1} - ${metric2}) * some_value
exp(${metric1} / 0.4)
log(${metrics/acc}) * 2
Select metrics dynamically
Use regular expressions to select all metrics that match the pattern and dynamically display them on a chart. When you log more metrics that match the pattern, the chart gets updated automatically to include them.
- When you log new metrics that match an already applied regular expression, refresh the page to see them displayed on the chart.
- Dynamic selection isn't available in auto-generated dashboards.
To dynamically display metrics on the chart:
-
Go to Y-axis → Series → Dynamic selection.
-
In the input box, type a regular expression and click Apply.
You can apply one regular expression per chart. See also Syntax reference.
Export a widget
When your chart is ready, you can download it as a CSV table or a PNG image. You can also export a chart widget to a new or existing dashboard or report.
To access the export options, open the widget menu ().