Metrics
With Databand, you can define, capture, and monitor custom metrics for further insights into your data pipelines.
User-defined metrics can represent any quantitative measure of interest. These metrics can be a business KPI or a data quality measure, for example, counts, aggregations, summary statistics, or distribution measurements.
Metric values can be both simple types, such as string, integer, bool, and complex types, like lists or dicts.
After the metric values are defined, each execution of the pipeline sends the metric value to Databand. With Databand, you can analyze time-series metrics and create alerts based on the value of a metric for a particular pipeline execution.
Tracking metrics with the Databand SDK
To log metrics in Databand, use the log_metric()
function. This function accepts two parameters:
metric_name
-
A string identifier for a metric.
metric_value
-
The value for a metric during a particular execution.
You can enter simple and complex value types.
The following example shows how to use log_metric()
:
from dbnd import log_metric
def add_values(a: int, b:int):
sum = a + b
log_metric('total', sum)
return sum
add_values(12, 16)
You can use log_metrics
to simultaneously submit multiple metrics.