Functions library

The following article contains a categorized list of UDF (user-defined functions).

The user-defined functions code is given in the articles. It can be used within a let statement embedded in a query or can be persisted in a database using .create function.

Machine learning functions

Function Name Description
kmeans_fl() Clusterize using the k-means algorithm.
predict_fl() Predict using an existing trained machine learning model.
predict_onnx_fl() Predict using an existing trained machine learning model in ONNX format.

PromQL functions

The following section contains common PromQL functions. These functions can be used for analysis of metrics ingested to Azure Data Explorer by the Prometheus monitoring system. All functions assume that metrics in Azure Data Explorer are structured using the Prometheus data model.

Function Name Description
series_metric_fl() Select and retrieve time series stored with the Prometheus data model.
series_rate_fl() Calculate the average rate of counter metric increase per second.

Series processing functions

Function Name Description
quantize_fl() Quantize metric columns.
series_dbl_exp_smoothing_fl() Apply a double exponential smoothing filter on a series.
series_dot_product_fl() Calculate the dot product of two numerical vectors.
series_downsample_fl() Downsample a time series by an integer factor.
series_exp_smoothing_fl() Apply a basic exponential smoothing filter on a series.
series_fit_lowess_fl() Fit a local polynomial to series using LOWESS method.
series_fit_poly_fl() Fit a polynomial to series using regression analysis.
series_fbprophet_forecast_fl() Forecast time series values using the Prophet algorithm.
series_moving_avg_fl() Apply a moving average filter on a series.
series_rolling_fl() Apply a rolling aggregation function on a series.
time_weighted_avg_fl() Calculates the time weighted average of a metric.

Statistical and probability functions

Function Name Description
binomial_test_fl() Perform the binomial test.
comb_fl() Calculate C(n, k), the number of combinations for selection of k items out of n.
factorial_fl() Calculate n!, the factorial of n.
perm_fl() Calculate P(n, k), the number of permutations for selection of k items out of n.