Metrics
Enrich events with pre-calculated metrics to facilitate further advanced processing
Objective
Advanced use cases may need pre-computed metrics as inputs for calculations, event triggers, or additional context.
The enricher processor uses the Metrics Engine query interface to query and bind metrics to an event using additional DSL attributes
Uses
There are various uses for this filter such as:
In retail Utilise real-time sales data and competitor pricing metrics to adjust product prices dynamically, maximising profit margins and ensuring competitiveness.
In manufacturing Use sensor data from machinery to predict failures before they occur, enabling proactive maintenance scheduling and reducing unplanned downtime.
In e-commerce Combine user behaviour data with product performance metrics to generate personalised product recommendations, enhancing the customer shopping experience.
Example & DSL attributes
This example defines three enrichment strategies:
bid_ask_avg Retrieves
avg_askandavg_bidvalues by using theAskBidMovingAveragemetric family andsymbolas the key from theMetricsDB.market_depth_metrics Fetches all attributes related to
marketDepthfor a givensymbolfrom theMetricsDB.trading_triggers Retrieves
tradingTriggersdata as an object for a givensymbolfrom theMetricsDB.
All enrichments use the MetricsDB for data retrieval.
enricher:
fields:
bid_ask_avg:
by metric family: AskBidMovingAverage
by key: symbol
with values: [avg_ask, avg_bid]
using: MetricsDB
market_depth_metrics:
by metric family: marketDepth
by key: symbol
all attributes: true
using: MetricsDB
trading_triggers:
by metric family: tradingTriggers
by key: symbol
as object: true
using: MetricsDBAttributes schema
To direct the enricher to use the computed in-memory metrics database two attributes must be set.
by metric family
Metrics family to query against. This must be defined in the use case
String
using: MetricsDB
Directs the processor to bind to the metrics engine
String
Last updated
Was this helpful?