You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data-management/certified-metrics/eppo-schema.md
+128-9Lines changed: 128 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,20 +54,139 @@ Numerators and denominators follow a similar schema, with some fields only being
54
54
| Property | Description | Example |
55
55
| -------- | ----------- | ------- |
56
56
|`fact_name`| The name of a fact as specified in `fact_source`*| Purchase Revenue |
57
-
|`operation`| The [aggregation method](/data-management/metrics/simple-metric#aggregation-methods) to use. <br></br><br></br>For numerator aggregations options are `sum, count, count_distinct, distinct_entity, threshold, conversion, retention`. <br></br><br></br>For denominator aggregations, valid options are `sum, count, count_distinct, distinct_entity`|`sum`|
58
-
|`aggregation_timeframe_start_value` <br></br> (optional) | Timeframe units since assignment after which events are included | 2 |
59
-
|`aggregation_timeframe_end_value` <br></br> (optional) | Timeframe units since assignment after which events are excluded | 7 |
60
-
|`aggregation_timeframe_unit` <br></br> (optional) | The time unit to use: `minutes`, `hours`, `days`, or `weeks`|`days`|
61
-
|`winsorization_lower_percentile` <br></br> (optional) | Percentile at which to clip aggregated metrics | 0.001 |
62
-
|`winsorization_upper_percentile` <br></br> (optional) | Percentile at which to clip aggregated metrics | 0.999 |
57
+
|`operation`| The [aggregation method](/data-management/metrics/simple-metric#aggregation-methods) to use. <br></br><br></br>For numerator aggregations options are `sum, count, count_distinct, distinct_entity, threshold, conversion, retention`. <br></br><br></br>For denominator aggregations, valid options are `sum, count, count_distinct, distinct_entity`<br></br><br></br>**Note**: See [Constraints and Limitations](#constraints-and-limitations) for operation-specific parameter restrictions. |`sum`|
58
+
|`aggregation_timeframe_start_value` <br></br> (optional) | Timeframe units since assignment after which events are included. <br></br><br></br>**Constraint**: Cannot be used with `conversion` operations. Requires `aggregation_timeframe_unit` to be specified.| 2 |
59
+
|`aggregation_timeframe_end_value` <br></br> (optional) | Timeframe units since assignment after which events are excluded. <br></br><br></br>**Constraint**: Cannot be used with `conversion` operations. Requires `aggregation_timeframe_unit` to be specified.| 7 |
60
+
|`aggregation_timeframe_unit` <br></br> (optional) | The time unit to use: `minutes`, `hours`, `days`, or `weeks`. <br></br><br></br>**Constraint**: Required when any timeframe parameters are used.|`days`|
61
+
|`winsorization_lower_percentile` <br></br> (optional) | Percentile at which to clip aggregated metrics. <br></br><br></br>**Constraint**: Only supported for `sum`, `count`, `last_value`, and `first_value` operations.| 0.001 |
62
+
|`winsorization_upper_percentile` <br></br> (optional) | Percentile at which to clip aggregated metrics. <br></br><br></br>**Constraint**: Only supported for `sum`, `count`, `last_value`, and `first_value` operations.| 0.999 |
63
63
|`filters` <br></br> (optional) | A list of filters to apply to metric, each containing a fact property, an operation (`equals` or `not_equals`), and a list of values | <pre><code>- fact_property: Source <br></br> operation: equals <br></br> values: <br></br> - organic <br></br> - search </code></pre> |
64
-
|`retention_threshold_days` <br></br> (optional, numerators only) | Number of days to use in retention calculation (only used if`operation` = `retention`)| 7 |
65
-
|`conversion_threshold_days` <br></br> (optional, numerators only) | Number of days to use in conversion calculation (only used if`operation` = `conversion`)| 7 |
66
-
|`threshold_metric_settings` <br></br> (optional, numerators only) |Setting for threshold metrics | <pre><code>comparison_operator: gt <br></br>aggregation_type: sum <br></br>breach_value: 0 <br></br>timeframe_unit: days <br></br>timeframe_value: 3 </code></pre> |
64
+
|`retention_threshold_days` <br></br> (optional, numerators only) | Number of days to use in retention calculation. <br></br><br></br>**Constraint**: Only used with`operation` = `retention`. Cannot be combined with other advanced aggregation parameters.| 7 |
65
+
|`conversion_threshold_days` <br></br> (optional, numerators only) | Number of days to use in conversion calculation. <br></br><br></br>**Constraint**: Only used with`operation` = `conversion`. Cannot be combined with other advanced aggregation parameters or timeframe parameters.| 7 |
66
+
|`threshold_metric_settings` <br></br> (optional, numerators only) |Settings for threshold metrics. <br></br><br></br>**Constraint**: Required when `operation` = `threshold`. Cannot be combined with other advanced aggregation parameters.| <pre><code>comparison_operator: gt <br></br>aggregation_type: sum <br></br>breach_value: 0 <br></br>timeframe_unit: days <br></br>timeframe_value: 3 </code></pre> |
67
67
68
68
69
69
*Note that `fact_name` can reference facts defined in a different yaml file.
70
70
71
+
## Constraints and Limitations
72
+
73
+
When defining certified metrics, there are several important constraints to be aware of. These validation rules help ensure your metrics are configured correctly and will help prevent common configuration errors.
74
+
75
+
### Winsorization Constraints
76
+
77
+
Winsorization parameters (`winsorization_lower_percentile` and `winsorization_upper_percentile`) can **only** be used with the following aggregation operations:
78
+
-`sum`
79
+
-`count`
80
+
-`last_value`
81
+
-`first_value`
82
+
83
+
**Cannot be used with:**
84
+
-`count_distinct`
85
+
-`distinct_entity`
86
+
-`threshold`
87
+
-`retention`
88
+
-`conversion`
89
+
90
+
:::warning
91
+
Attempting to use winsorization with unsupported operations like `count_distinct` or `threshold` will result in a validation error.
92
+
:::
93
+
94
+
### Advanced Aggregation Parameter Constraints
95
+
96
+
Advanced aggregation parameters have strict operation requirements:
-**Cannot use**: Other advanced aggregation parameters
111
+
-**Operation**: Must be `threshold`
112
+
113
+
### Timeframe Parameter Constraints
114
+
115
+
Timeframe parameters (`aggregation_timeframe_start_value`, `aggregation_timeframe_end_value`, `aggregation_timeframe_unit`) have the following restrictions:
116
+
117
+
-**Cannot be used** with `conversion` operations
118
+
-**Must include**`aggregation_timeframe_unit` if any timeframe parameters are specified
119
+
- The deprecated `aggregation_timeframe_value` parameter should be replaced with `aggregation_timeframe_end_value`
120
+
121
+
### Threshold Metric Settings
122
+
123
+
When using `threshold_metric_settings` for threshold operations, the settings object must include:
124
+
-`comparison_operator`: The comparison operator to use (e.g., `gt`, `lt`, `gte`, `lte`, `eq`)
125
+
-`aggregation_type`: The aggregation type to apply before threshold comparison
126
+
-`breach_value`: The threshold value to compare against
127
+
-`timeframe_unit`: The time unit for the threshold calculation
128
+
-`timeframe_value`: The time value for the threshold calculation
129
+
130
+
### Denominator Operation Constraints
131
+
132
+
For ratio metrics, denominator aggregations are limited to:
133
+
-`sum`
134
+
-`count`
135
+
-`count_distinct`
136
+
-`distinct_entity`
137
+
138
+
**Cannot use** advanced operations like `threshold`, `retention`, or `conversion` in denominators.
139
+
140
+
### Common Validation Examples
141
+
142
+
Here are some examples of **invalid** configurations that will trigger validation errors:
0 commit comments