From da6d605ae0a69833261d93b12dc56ac8336b7005 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 12 Mar 2026 15:14:04 +0100 Subject: [PATCH] Add sample metric YAML as fallback when OpenMetadata metrics unavailable The /api/v1/metrics endpoint may not be available in all OpenMetadata instances. This sample metric provides a fallback for demonstration purposes. --- docs/metrics/revenue/total_revenue.yml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/metrics/revenue/total_revenue.yml diff --git a/docs/metrics/revenue/total_revenue.yml b/docs/metrics/revenue/total_revenue.yml new file mode 100644 index 0000000..812a91b --- /dev/null +++ b/docs/metrics/revenue/total_revenue.yml @@ -0,0 +1,40 @@ +- name: total_revenue + display_name: Total Revenue + category: revenue + type: sum + unit: USD + grain: monthly + time_column: order_date + table: orders + expression: "SUM(total_amount)" + description: "Total revenue from all orders. Primary top-line metric tracking overall business performance across all channels and product categories." + dimensions: + - channel + - product_category + - region + - payment_method + notes: + - "Includes all completed orders, excludes cancelled and refunded" + - "Revenue is recognized at order completion date, not payment date" + - "Multi-currency orders are converted to USD at daily exchange rate" + synonyms: + - gross_revenue + - total_sales + - top_line_revenue + sql: | + SELECT + DATE_TRUNC('month', order_date) AS month, + SUM(total_amount) AS total_revenue + FROM orders + WHERE status = 'completed' + GROUP BY 1 + ORDER BY 1 + sql_by_channel: | + SELECT + DATE_TRUNC('month', order_date) AS month, + channel, + SUM(total_amount) AS revenue + FROM orders + WHERE status = 'completed' + GROUP BY 1, 2 + ORDER BY 1, 3 DESC