diff --git a/README.md b/README.md index 464cac4..e6c2d30 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ This project uses Tinybird's [Service Data Sources](https://www.tinybird.co/docs - Pipe endpoint usage: Analyze requests and identify unusual traffic patterns. - Storage: Monitor storage usage to optimize resources and avoid limits. - Jobs: Keep track of the status and performance of scheduled jobs. + - Cluster health: Export every metric tracked by `organization.metrics_logs` per cluster host. + - Data transfer: Track transferred bytes by provider, region, event, and transfer kind. + - Sinks: Monitor executions, errors, duration, CPU, rows, and bytes by Sink Pipe. + - LLM usage: Track requests, tokens, duration, and cost by feature and origin. + - Backups: Monitor backup counts and the status, duration, and size of the latest backup. + - Private Link: Track provider-reported usage and cost. ## Get started @@ -37,6 +43,18 @@ tb --cloud deploy --template https://github.com/tinybirdco/tinybird-org-metrics- Access the Prometheus metrics endpoint at `https://api.tinybird.co/v0/pipes/organization_metrics.prometheus`. +The combined endpoint includes all metrics. Each category is also available as an +individual Prometheus endpoint: + +| Endpoint | Source | +| --- | --- | +| `cluster` | `organization.metrics_logs` | +| `data_transfer` | `organization.data_transfer` | +| `sinks` | `organization.sinks_ops_log` | +| `llm_usage` | `organization.llm_usage` | +| `backups` | `organization.backups` | +| `private_link` | `organization.private_link` | + - Replace `api.tinybird.co` with your Tinybird host if the workspace is in a different region. See [Regions and endpoints](https://www.tinybird.co/docs/api-reference#regions-and-endpoints). - **Token**: for a quick check in development, you can use the pre-existing *admin `user@domain` Token* of an Organization admin to authenticate requests. But for production, create a dedicated token with minimal permissions using the [Tinybird CLI](https://www.tinybird.co/docs/forward/get-started/administration/tokens): diff --git a/TEMPLATE.md b/TEMPLATE.md index 631f554..b57c5f4 100644 --- a/TEMPLATE.md +++ b/TEMPLATE.md @@ -1,5 +1,10 @@ This Org Metrics Exporter template uses Tinybird's [Service Data Sources](https://www.tinybird.co/docs/monitoring/organizations#organization-service-data-sources) to aggregate and publish organizational metrics as endpoints in [Prometheus format](https://www.tinybird.co/docs/forward/work-with-data/publish-data/guides/consume-api-endpoints-in-prometheus-format) for quick integration with common monitoring tools. +It exports ingestion, request, storage, job, cluster, data transfer, Sink, LLM +usage, backup, and Private Link metrics. The `organization_metrics` endpoint +combines every category, while `cluster`, `data_transfer`, `sinks`, +`llm_usage`, `backups`, and `private_link` can be scraped independently. + ## Set up the project ```bash diff --git a/datadog/tinybird_org_metrics.json b/datadog/tinybird_org_metrics.json index 66d5356..3cead0f 100644 --- a/datadog/tinybird_org_metrics.json +++ b/datadog/tinybird_org_metrics.json @@ -1 +1 @@ -{"title":"Org metrics","description":null,"widgets":[{"id":7635410957855592,"definition":{"title":"Ingestion rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"ingestion rate by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_total{$workspace,$event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":0,"width":6,"height":3}},{"id":4379743123832388,"definition":{"title":"Ingestion errors rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion errors rate by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_errors_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":0,"width":6,"height":3}},{"id":4111859251320234,"definition":{"title":"Ingestion written rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion written rows by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_written_rows_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":3,"width":6,"height":3}},{"id":7150774719244392,"definition":{"title":"Ingestion written bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion written bytes by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_written_bytes_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":3,"width":6,"height":3}},{"id":2008890324991352,"definition":{"title":"Ingestion read rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion read rows by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_read_rows_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":6,"width":6,"height":3}},{"id":3667685782848470,"definition":{"title":"Ingestion read bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion read bytes by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_read_bytes_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":6,"width":6,"height":3}},{"id":5012083620213328,"definition":{"title":"Ingestion avg latency 5m","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion avg latency 5m by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.ingestion_latency_avg_5m{$workspace, $event_type} by {workspace,event_type}.rollup(sum, 300)"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":9,"width":6,"height":3}},{"id":1188808299756500,"definition":{"title":"Ingestion storage total","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion storage total by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.storage_bytes{$workspace} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":9,"width":6,"height":3}},{"id":3705706026851914,"definition":{"title":"Jobs success","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs success by workspace and job type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_total{$workspace and status:done} by {workspace,job_type}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":12,"width":4,"height":2}},{"id":6682042019573766,"definition":{"title":"Jobs WIP","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs WIP by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_total{$workspace and (status:waiting or status:working)} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":4,"y":12,"width":4,"height":2}},{"id":3109033572139802,"definition":{"title":"Jobs failed","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs failed by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_total{$workspace and status:error*} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":8,"y":12,"width":4,"height":2}},{"id":6936085618363592,"definition":{"title":"Requests rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_views_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":14,"width":6,"height":3}},{"id":6866289577326118,"definition":{"title":"Requests error rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests error by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_errors_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":14,"width":6,"height":3}},{"id":6468452413664580,"definition":{"title":"Requests read rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests read rows by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_read_rows_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":17,"width":4,"height":4}},{"id":7469127801031568,"definition":{"title":"Requests read bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests read bytes by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_read_bytes_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":4,"y":17,"width":4,"height":4}},{"id":5870957598598524,"definition":{"title":"Requests avg latency","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests avg latency by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.requests_latency_avg_5m{$workspace, $pipe} by {workspace,pipe}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":8,"y":17,"width":4,"height":4}}],"template_variables":[{"name":"workspace","prefix":"workspace","available_values":[],"default":"*"},{"name":"event_type","prefix":"event_type","available_values":[],"default":"*"},{"name":"pipe","prefix":"pipe","available_values":[],"default":"*"}],"layout_type":"ordered","notify_list":[],"reflow_type":"fixed"} \ No newline at end of file +{"title":"Org metrics","description":null,"widgets":[{"id":7635410957855592,"definition":{"title":"Ingestion rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"ingestion rate by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_total{$workspace,$event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":0,"width":6,"height":3}},{"id":4379743123832388,"definition":{"title":"Ingestion errors rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion errors rate by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_errors_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":0,"width":6,"height":3}},{"id":4111859251320234,"definition":{"title":"Ingestion written rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion written rows by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_written_rows_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":3,"width":6,"height":3}},{"id":7150774719244392,"definition":{"title":"Ingestion written bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion written bytes by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_written_bytes_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":3,"width":6,"height":3}},{"id":2008890324991352,"definition":{"title":"Ingestion read rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion read rows by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_read_rows_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":6,"width":6,"height":3}},{"id":3667685782848470,"definition":{"title":"Ingestion read bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion read bytes by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.ingestion_read_bytes_total{$workspace, $event_type} by {workspace,event_type}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":6,"width":6,"height":3}},{"id":5012083620213328,"definition":{"title":"Ingestion avg latency 5m","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion avg latency 5m by workspace and event type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.ingestion_latency_avg_5m{$workspace, $event_type} by {workspace,event_type}.rollup(sum, 300)"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":9,"width":6,"height":3}},{"id":1188808299756500,"definition":{"title":"Ingestion storage total","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"alias":"Ingestion storage total by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.storage_bytes{$workspace} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":9,"width":6,"height":3}},{"id":3705706026851914,"definition":{"title":"Jobs success","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs success by workspace and job type","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_in_window{$workspace and status:done} by {workspace,job_type}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":12,"width":4,"height":2}},{"id":6682042019573766,"definition":{"title":"Jobs WIP","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs WIP by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_in_window{$workspace and (status:waiting or status:working)} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":4,"y":12,"width":4,"height":2}},{"id":3109033572139802,"definition":{"title":"Jobs failed","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Jobs failed by workspace","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.jobs_in_window{$workspace and status:error*} by {workspace}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":8,"y":12,"width":4,"height":2}},{"id":6936085618363592,"definition":{"title":"Requests rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_views_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":14,"width":6,"height":3}},{"id":6866289577326118,"definition":{"title":"Requests error rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests error by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_errors_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":14,"width":6,"height":3}},{"id":6468452413664580,"definition":{"title":"Requests read rows","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests read rows by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_read_rows_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":17,"width":4,"height":4}},{"id":7469127801031568,"definition":{"title":"Requests read bytes","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests read bytes by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.requests_read_bytes_total{$workspace, $pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":4,"y":17,"width":4,"height":4}},{"id":5870957598598524,"definition":{"title":"Requests avg latency","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Requests avg latency by workspace and pipe","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.requests_latency_avg_5m{$workspace, $pipe} by {workspace,pipe}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":8,"y":17,"width":4,"height":4}},{"id":8800000000000001,"definition":{"title":"Cluster CPU usage","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"CPU usage by cluster and host","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.cluster_cpu_usage{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":21,"width":6,"height":3}},{"id":8800000000000002,"definition":{"title":"Cluster memory","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Tracked memory by cluster and host","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.cluster_memory_tracking{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Total OS memory by cluster and host","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"avg:tinybird_org_metrics.cluster_os_memory_bytes{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":21,"width":6,"height":3}},{"id":8800000000000003,"definition":{"title":"Cluster activity","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Load average 1m","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.cluster_load_average1{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Load average 15m","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"avg:tinybird_org_metrics.cluster_load_average15{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Executing queries","formula":"query3"}],"queries":[{"data_source":"metrics","name":"query3","query":"avg:tinybird_org_metrics.cluster_query{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":24,"width":6,"height":3}},{"id":8800000000000004,"definition":{"title":"Replication queues","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Total queue","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.cluster_replicas_sum_queue_size{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Inserts queue","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"avg:tinybird_org_metrics.cluster_replicas_sum_inserts_in_queue{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Merges queue","formula":"query3"}],"queries":[{"data_source":"metrics","name":"query3","query":"avg:tinybird_org_metrics.cluster_replicas_sum_merges_in_queue{*} by {cluster,host}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":24,"width":6,"height":3}},{"id":8800000000000005,"definition":{"title":"Data transfer rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Transferred bytes by workspace and route","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.data_transfer_bytes_total{$workspace} by {workspace,origin_provider,destination_provider,kind}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":27,"width":6,"height":3}},{"id":8800000000000006,"definition":{"title":"Sink executions and errors","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Sink executions","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.sinks_executions_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Sink errors","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.sinks_errors_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":27,"width":6,"height":3}},{"id":8800000000000007,"definition":{"title":"Sink throughput","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Sink bytes read","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.sinks_read_bytes_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Sink bytes written","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.sinks_written_bytes_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":30,"width":6,"height":3}},{"id":8800000000000008,"definition":{"title":"Sink time per execution","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Sink elapsed time","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.sinks_elapsed_time_seconds_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Sink CPU time","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.sinks_cpu_time_seconds_total{$workspace,$pipe} by {workspace,pipe}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":30,"width":6,"height":3}},{"id":8800000000000009,"definition":{"title":"LLM requests and tokens","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"LLM requests","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.llm_requests_total{$workspace} by {workspace,origin,feature}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Prompt tokens","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.llm_prompt_tokens_total{$workspace} by {workspace,origin,feature}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Completion tokens","formula":"query3"}],"queries":[{"data_source":"metrics","name":"query3","query":"sum:tinybird_org_metrics.llm_completion_tokens_total{$workspace} by {workspace,origin,feature}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":33,"width":6,"height":3}},{"id":8800000000000010,"definition":{"title":"LLM duration and cost rate","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"LLM duration","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.llm_duration_seconds_total{$workspace} by {workspace,origin,feature}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"LLM cost","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.llm_cost_total{$workspace} by {workspace,origin,feature}.as_rate()"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":33,"width":6,"height":3}},{"id":8800000000000011,"definition":{"title":"Latest backup duration","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Latest backup duration","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.backup_last_duration_seconds{status:BACKUP_CREATED} by {cluster,full}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Backups","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"max:tinybird_org_metrics.backups_total{status:BACKUP_CREATED} by {cluster,full}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":36,"width":6,"height":3}},{"id":8800000000000012,"definition":{"title":"Latest backup size","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Total backup size","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:tinybird_org_metrics.backup_last_total_size_bytes{status:BACKUP_CREATED} by {cluster,full}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Compressed backup size","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"avg:tinybird_org_metrics.backup_last_compressed_size_bytes{status:BACKUP_CREATED} by {cluster,full}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Uncompressed backup size","formula":"query3"}],"queries":[{"data_source":"metrics","name":"query3","query":"avg:tinybird_org_metrics.backup_last_uncompressed_size_bytes{status:BACKUP_CREATED} by {cluster,full}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":36,"width":6,"height":3}},{"id":8800000000000013,"definition":{"title":"Private Link cost","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Private Link cost","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.private_link_cost_total{*} by {region,currency}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"},{"formulas":[{"alias":"Private Link blended cost","formula":"query2"}],"queries":[{"data_source":"metrics","name":"query2","query":"sum:tinybird_org_metrics.private_link_blended_cost_total{*} by {region,currency}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":0,"y":39,"width":6,"height":3}},{"id":8800000000000014,"definition":{"title":"Private Link usage","title_size":"16","title_align":"left","show_legend":true,"legend_layout":"vertical","legend_columns":["avg","min","max","value","sum"],"type":"timeseries","requests":[{"formulas":[{"alias":"Private Link usage","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"sum:tinybird_org_metrics.private_link_usage_amount_total{*} by {region,usage_type,operation}"}],"response_format":"timeseries","style":{"palette":"dog_classic","order_by":"values","line_type":"solid","line_width":"normal"},"display_type":"line"}]},"layout":{"x":6,"y":39,"width":6,"height":3}}],"template_variables":[{"name":"workspace","prefix":"workspace","available_values":[],"default":"*"},{"name":"event_type","prefix":"event_type","available_values":[],"default":"*"},{"name":"pipe","prefix":"pipe","available_values":[],"default":"*"}],"layout_type":"ordered","notify_list":[],"reflow_type":"fixed"} diff --git a/grafana/tinybird_org_metrics.json b/grafana/tinybird_org_metrics.json index 25c6a9d..fe57834 100644 --- a/grafana/tinybird_org_metrics.json +++ b/grafana/tinybird_org_metrics.json @@ -1012,7 +1012,7 @@ "disableTextWrap": false, "editorMode": "code", "exemplar": false, - "expr": "jobs_total{workspace=~\"$workspace\", job=\"tinybird_org_metrics\", status=\"done\"}", + "expr": "jobs_in_window{workspace=~\"$workspace\", job=\"tinybird_org_metrics\", status=\"done\"}", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": false, @@ -1119,7 +1119,7 @@ "disableTextWrap": false, "editorMode": "code", "exemplar": false, - "expr": "jobs_total{workspace=~\"$workspace\", job=\"tinybird_org_metrics\", status=~\"waiting|working\"}", + "expr": "jobs_in_window{workspace=~\"$workspace\", job=\"tinybird_org_metrics\", status=~\"waiting|working\"}", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": false, @@ -1226,7 +1226,7 @@ "disableTextWrap": false, "editorMode": "code", "exemplar": false, - "expr": "jobs_total{workspace=~\"$workspace\", job=\"oa_metrics\", status=\"error\"}", + "expr": "jobs_in_window{workspace=~\"$workspace\", job=\"tinybird_org_metrics\", status=\"error\"}", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": false, @@ -2037,6 +2037,1729 @@ ], "title": "Requests cpu 5m", "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 99 + }, + "id": 19, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_cpu_usage{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}}-{{host}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Cluster CPU usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 99 + }, + "id": 20, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_memory_tracking{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}}-{{host}} tracked", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_os_memory_bytes{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}}-{{host}} total", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Cluster memory", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 108 + }, + "id": 21, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_load_average1{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} load 1m", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_load_average15{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} load 15m", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_query{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} queries", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "Cluster activity", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 108 + }, + "id": 22, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_replicas_sum_queue_size{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} queue", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_replicas_sum_inserts_in_queue{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} inserts", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "cluster_replicas_sum_merges_in_queue{job=\"tinybird_org_metrics\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{host}} merges", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "Replication queues", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 117 + }, + "id": 23, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin_provider, destination_provider, kind) (rate(data_transfer_bytes_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}} {{origin_provider}} to {{destination_provider}} {{kind}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Data transfer rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 117 + }, + "id": 24, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_executions_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} executions", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_errors_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} errors", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Sink executions and errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 126 + }, + "id": 25, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_read_bytes_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} read", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_written_bytes_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} written", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Sink throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 126 + }, + "id": 26, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_elapsed_time_seconds_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval])) / sum by(workspace, pipe) (rate(sinks_executions_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} elapsed", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, pipe) (rate(sinks_cpu_time_seconds_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval])) / sum by(workspace, pipe) (rate(sinks_executions_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\", pipe=~\"$pipe\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{pipe}} CPU", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Sink time per execution", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 135 + }, + "id": 27, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin, feature) (rate(llm_requests_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{origin}}-{{feature}} requests", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin, feature) (rate(llm_prompt_tokens_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{origin}}-{{feature}} prompt tokens", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin, feature) (rate(llm_completion_tokens_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{origin}}-{{feature}} completion tokens", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "LLM requests and tokens", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 135 + }, + "id": 28, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin, feature) (rate(llm_duration_seconds_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{origin}}-{{feature}} duration", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(workspace, origin, feature) (rate(llm_cost_total{job=\"tinybird_org_metrics\", workspace=~\"$workspace\"}[$__rate_interval]))", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{workspace}}-{{origin}}-{{feature}} cost", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "LLM duration and cost rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 144 + }, + "id": 29, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "time() - backup_last_end_timestamp_seconds{job=\"tinybird_org_metrics\", status=\"BACKUP_CREATED\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}} full={{full}} age", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "backup_last_duration_seconds{job=\"tinybird_org_metrics\", status=\"BACKUP_CREATED\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}} full={{full}} duration", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Latest backup age and duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 144 + }, + "id": 30, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "backup_last_total_size_bytes{job=\"tinybird_org_metrics\", status=\"BACKUP_CREATED\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}} full={{full}} total", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "backup_last_compressed_size_bytes{job=\"tinybird_org_metrics\", status=\"BACKUP_CREATED\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}} full={{full}} compressed", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "backup_last_uncompressed_size_bytes{job=\"tinybird_org_metrics\", status=\"BACKUP_CREATED\"}", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{cluster}} full={{full}} uncompressed", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "Latest backup size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 153 + }, + "id": 31, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(region, currency) (private_link_cost_total{job=\"tinybird_org_metrics\"})", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{region}} {{currency}} cost", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(region, currency) (private_link_blended_cost_total{job=\"tinybird_org_metrics\"})", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{region}} {{currency}} blended", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Private Link cost", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 153 + }, + "id": 32, + "options": { + "legend": { + "calcs": [ + "sum", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Total", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.3.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_MIMIR}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(region, usage_type, operation) (private_link_usage_amount_total{job=\"tinybird_org_metrics\"})", + "fullMetaSearch": false, + "includeNullMetadata": false, + "legendFormat": "{{region}} {{usage_type}} {{operation}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Private Link usage", + "type": "timeseries" } ], "schemaVersion": 40, @@ -2113,6 +3836,6 @@ "timezone": "browser", "title": "OA org metrics", "uid": "fe5p52ak1ee4gd2", - "version": 36, + "version": 37, "weekStart": "" -} \ No newline at end of file +} diff --git a/tinybird/.env.example b/tinybird/.env.example new file mode 100644 index 0000000..af54f54 --- /dev/null +++ b/tinybird/.env.example @@ -0,0 +1,2 @@ +TB_HOST=https://api.tinybird.co +TB_TOKEN= diff --git a/tinybird/.env.local b/tinybird/.env.local deleted file mode 100644 index e69de29..0000000 diff --git a/tinybird/.gitignore b/tinybird/.gitignore index 464c1bb..e2e4b8d 100644 --- a/tinybird/.gitignore +++ b/tinybird/.gitignore @@ -1,2 +1,3 @@ .tinyb .terraform +.env.local diff --git a/tinybird/endpoints/backups.pipe b/tinybird/endpoints/backups.pipe new file mode 100644 index 0000000..5c1693b --- /dev/null +++ b/tinybird/endpoints/backups.pipe @@ -0,0 +1,120 @@ +DESCRIPTION > + Returns cumulative backup counts and gauges for the latest backup tracked by + organization.backups, grouped by organization, cluster, status, and backup type. + +TOKEN "backups_endpoint_read" READ + +NODE backups_prometheus +SQL > + SELECT + '' AS workspace_id, + metric['name'] AS name, + metric['type'] AS type, + metric['help'] AS help, + toFloat64(metric['value']) AS value, + map( + 'organization_id', + organization_id, + 'cluster', + cluster, + 'status', + status, + 'full', + toString(is_full_backup) + ) AS labels + FROM + ( + SELECT + organization_id, + cluster, + status, + is_full_backup, + count() AS backups_total, + argMax(toUnixTimestamp(start_time), start_time) AS last_start_timestamp_seconds, + argMax(toUnixTimestamp(end_time), start_time) AS last_end_timestamp_seconds, + argMax( + dateDiff('millisecond', start_time, end_time) / 1000.0, start_time + ) AS last_duration_seconds, + argMax(total_size, start_time) AS last_total_size_bytes, + argMax(compressed_size, start_time) AS last_compressed_size_bytes, + argMax(uncompressed_size, start_time) AS last_uncompressed_size_bytes + FROM organization.backups + GROUP BY organization_id, cluster, status, is_full_backup + ) + ARRAY + JOIN + [ + map( + 'name', + 'backups_total', + 'type', + 'counter', + 'help', + 'Total backups', + 'value', + toString(backups_total) + ), + map( + 'name', + 'backup_last_start_timestamp_seconds', + 'type', + 'gauge', + 'help', + 'Unix timestamp of the latest backup start', + 'value', + toString(last_start_timestamp_seconds) + ), + map( + 'name', + 'backup_last_end_timestamp_seconds', + 'type', + 'gauge', + 'help', + 'Unix timestamp of the latest backup end', + 'value', + toString(last_end_timestamp_seconds) + ), + map( + 'name', + 'backup_last_duration_seconds', + 'type', + 'gauge', + 'help', + 'Duration of the latest backup in seconds', + 'value', + toString(last_duration_seconds) + ), + map( + 'name', + 'backup_last_total_size_bytes', + 'type', + 'gauge', + 'help', + 'Total size reported for the latest backup in bytes', + 'value', + toString(last_total_size_bytes) + ), + map( + 'name', + 'backup_last_compressed_size_bytes', + 'type', + 'gauge', + 'help', + 'Compressed size of the latest backup in bytes', + 'value', + toString(last_compressed_size_bytes) + ), + map( + 'name', + 'backup_last_uncompressed_size_bytes', + 'type', + 'gauge', + 'help', + 'Uncompressed size of the latest backup in bytes', + 'value', + toString(last_uncompressed_size_bytes) + ) + ] AS metric + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/cluster.pipe b/tinybird/endpoints/cluster.pipe new file mode 100644 index 0000000..6e97f65 --- /dev/null +++ b/tinybird/endpoints/cluster.pipe @@ -0,0 +1,36 @@ +DESCRIPTION > + Returns every host metric tracked by organization.metrics_logs. + Each series contains the latest sampled value and is exposed as a Prometheus gauge, + grouped by organization, cluster, and host. + +TOKEN "cluster_endpoint_read" READ + +NODE cluster_prometheus +SQL > + SELECT + '' AS workspace_id, + CAST( + if( + metric = 'OSMemoryTotal', + 'cluster_os_memory_bytes', + concat( + 'cluster_', + lower( + replaceRegexpAll( + replaceRegexpAll(metric, '([A-Z]+)([A-Z][a-z])', '\\1_\\2'), + '([a-z0-9])([A-Z])', + '\\1_\\2' + ) + ) + ) + ) AS String + ) AS name, + 'gauge' AS type, + argMax(description, timestamp) AS help, + argMax(toFloat64(value), timestamp) AS value, + map('organization_id', organization_id, 'cluster', cluster, 'host', host) AS labels + FROM organization.metrics_logs + GROUP BY organization_id, cluster, host, metric + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/data_transfer.pipe b/tinybird/endpoints/data_transfer.pipe new file mode 100644 index 0000000..07e0d7d --- /dev/null +++ b/tinybird/endpoints/data_transfer.pipe @@ -0,0 +1,42 @@ +DESCRIPTION > + Returns the total bytes tracked by organization.data_transfer as a Prometheus counter, + grouped by workspace, event, providers, regions, and transfer kind. + +TOKEN "data_transfer_endpoint_read" READ + +NODE data_transfer_prometheus +SQL > + SELECT + workspace_id, + 'data_transfer_bytes_total' AS name, + 'counter' AS type, + 'Total bytes transferred between providers and regions' AS help, + toFloat64(sum(bytes)) AS value, + map( + 'workspace_id', + workspace_id, + 'event', + event, + 'origin_provider', + origin_provider, + 'origin_region', + origin_region, + 'destination_provider', + destination_provider, + 'destination_region', + destination_region, + 'kind', + kind + ) AS labels + FROM organization.data_transfer + GROUP BY + workspace_id, + event, + origin_provider, + origin_region, + destination_provider, + destination_region, + kind + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/ingestion.pipe b/tinybird/endpoints/ingestion.pipe index 976b1ef..323bfda 100644 --- a/tinybird/endpoints/ingestion.pipe +++ b/tinybird/endpoints/ingestion.pipe @@ -30,7 +30,6 @@ SQL > SELECT workspace_id, event_type, - pipe_id, pipe_name, sum(executions) as executions_total, sum(error_count) as errors_total, @@ -45,7 +44,7 @@ SQL > event_type in [ 'append', 'append-hfi', 'append-kafka', 'append-dynamodb', 'replace', 'populateview', 'copy' ] - group by workspace_id, event_type, pipe_id, pipe_name + group by workspace_id, event_type, pipe_name @@ -69,7 +68,7 @@ SQL > AND event_type in [ 'append', 'append-hfi', 'append-kafka', 'append-dynamodb', 'replace', 'populateview', 'copy' ] - GROUP BY workspace_id, event_type, pipe_id, pipe_name + GROUP BY workspace_id, event_type, pipe_name @@ -313,7 +312,7 @@ SQL > metric_ingestion_total['type'] as type, metric_ingestion_total['help'] as help, toFloat64(metric_ingestion_total['value']) as value, - map('event_type', event_type, 'pipe', pipe_name) as labels + map('workspace_id', workspace_id, 'event_type', event_type, 'pipe', pipe_name) as labels FROM ingestion_totals_metrics UNION ALL SELECT @@ -322,7 +321,7 @@ SQL > metric_ingestion_kafka['type'] as type, metric_ingestion_kafka['help'] as help, toFloat64(metric_ingestion_kafka['value']) as value, - map('topic', topic) as labels + map('workspace_id', workspace_id, 'topic', topic) as labels FROM ingestion_kafka_metrics UNION ALL SELECT @@ -331,7 +330,8 @@ SQL > metric_ingestion_latency_5m['type'] as type, metric_ingestion_latency_5m['help'] as help, toFloat64(metric_ingestion_latency_5m['value']) as value, - map('event_type', event_type, 'pipe', pipe_name) as labels + map('workspace_id', workspace_id, 'event_type', event_type, 'pipe', pipe_name) as labels FROM ingestion_latency_5m_metrics + ORDER BY name TYPE endpoint diff --git a/tinybird/endpoints/jobs.pipe b/tinybird/endpoints/jobs.pipe index 1d2d9ad..4e14977 100644 --- a/tinybird/endpoints/jobs.pipe +++ b/tinybird/endpoints/jobs.pipe @@ -2,7 +2,7 @@ TOKEN "jobs_endpoint_read" READ DESCRIPTION > Returns ingestion metrics: - jobs_total + jobs_in_window jobs_duration_avg jobs_duration_p99 for a tinybird organization, grouped by workspace_id, job_type and status @@ -43,7 +43,7 @@ SQL > [ map( 'name', - 'jobs_total', + 'jobs_in_window', 'type', 'gauge', 'help', @@ -86,7 +86,8 @@ SQL > metric['type'] as type, metric['help'] as help, toFloat64(metric['value']) as value, - map('job_type', job_type, 'status', status) as labels + map('workspace_id', workspace_id, 'job_type', job_type, 'status', status) as labels FROM jobs_metrics + ORDER BY name TYPE endpoint diff --git a/tinybird/endpoints/llm_usage.pipe b/tinybird/endpoints/llm_usage.pipe new file mode 100644 index 0000000..68cab8c --- /dev/null +++ b/tinybird/endpoints/llm_usage.pipe @@ -0,0 +1,97 @@ +DESCRIPTION > + Returns cumulative request, token, duration, and cost metrics from + organization.llm_usage, grouped by workspace, origin, and feature. + +TOKEN "llm_usage_endpoint_read" READ + +NODE llm_usage_prometheus +SQL > + SELECT + workspace_id, + metric['name'] AS name, + metric['type'] AS type, + metric['help'] AS help, + toFloat64(metric['value']) AS value, + map('workspace_id', workspace_id, 'origin', origin, 'feature', feature) AS labels + FROM + ( + SELECT + workspace_id, + origin, + feature, + count() AS requests_total, + sum(prompt_tokens) AS prompt_tokens_total, + sum(completion_tokens) AS completion_tokens_total, + sum(total_tokens) AS tokens_total, + sum(duration) AS duration_seconds_total, + sum(cost) AS cost_total + FROM organization.llm_usage + GROUP BY workspace_id, origin, feature + ) + ARRAY + JOIN + [ + map( + 'name', + 'llm_requests_total', + 'type', + 'counter', + 'help', + 'Total LLM requests', + 'value', + toString(requests_total) + ), + map( + 'name', + 'llm_prompt_tokens_total', + 'type', + 'counter', + 'help', + 'Total prompt tokens consumed by LLM requests', + 'value', + toString(prompt_tokens_total) + ), + map( + 'name', + 'llm_completion_tokens_total', + 'type', + 'counter', + 'help', + 'Total completion tokens produced by LLM requests', + 'value', + toString(completion_tokens_total) + ), + map( + 'name', + 'llm_tokens_total', + 'type', + 'counter', + 'help', + 'Total tokens consumed and produced by LLM requests', + 'value', + toString(tokens_total) + ), + map( + 'name', + 'llm_duration_seconds_total', + 'type', + 'counter', + 'help', + 'Total duration of LLM requests in seconds', + 'value', + toString(duration_seconds_total) + ), + map( + 'name', + 'llm_cost_total', + 'type', + 'counter', + 'help', + 'Total cost reported for LLM requests', + 'value', + toString(cost_total) + ) + ] AS metric + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/organization_metrics.pipe b/tinybird/endpoints/organization_metrics.pipe index 2d2621f..0d63d6c 100644 --- a/tinybird/endpoints/organization_metrics.pipe +++ b/tinybird/endpoints/organization_metrics.pipe @@ -1,31 +1,61 @@ -TOKEN "organization_metrics_endpoint_read" READ - DESCRIPTION > - returns metrics from ingestion, storage, jobs and requests pipes - Use from_datetime to get metrics since a date time, except totals which always sums all values + Returns metrics from ingestion, storage, jobs, requests, cluster, data transfer, + sinks, LLM usage, backups, and private link Pipes. + Use from_datetime to get windowed ingestion, job, and request metrics since a date time. + Cumulative totals always sum all retained values. In the response each metric has a description of what it means in the help column - The labels column, contains the columns by which the metrics are grouped by, including the workspace name + The labels column contains the dimensions by which each metric is grouped. + Workspace-level metrics include the workspace name. The format is compatible with Prometheus +TOKEN "organization_metrics_endpoint_read" READ + NODE organization_metrics_union SQL > - - SELECT * FROM ingestion + SELECT * + FROM ingestion UNION ALL - SELECT * from storage + SELECT * + from storage UNION ALL - SELECT * from jobs + SELECT * + from jobs UNION ALL - SELECT * FROM requests - - + SELECT * + FROM requests + UNION ALL + SELECT * + FROM cluster + UNION ALL + SELECT * + FROM data_transfer + UNION ALL + SELECT * + FROM sinks + UNION ALL + SELECT * + FROM llm_usage + UNION ALL + SELECT * + FROM backups + UNION ALL + SELECT * + FROM private_link NODE organization_metrics_prometheus SQL > - - SELECT name, type, help, value, - mapConcat(labels, map('workspace', w.name)) AS labels + SELECT + name, + type, + help, + value, + if( + empty(metrics.workspace_id), + labels, + mapConcat(labels, map('workspace', if(empty(w.name), metrics.workspace_id, w.name))) + ) AS labels FROM organization_metrics_union as metrics - join organization.workspaces as w ON w.workspace_id = metrics.workspace_id + LEFT JOIN organization.workspaces as w ON w.workspace_id = metrics.workspace_id + ORDER BY name -TYPE endpoint +TYPE ENDPOINT diff --git a/tinybird/endpoints/private_link.pipe b/tinybird/endpoints/private_link.pipe new file mode 100644 index 0000000..c5150bd --- /dev/null +++ b/tinybird/endpoints/private_link.pipe @@ -0,0 +1,102 @@ +DESCRIPTION > + Returns cumulative usage and cost metrics from organization.private_link, + grouped by the dimensions and currency reported by the provider. + +TOKEN "private_link_endpoint_read" READ + +NODE private_link_prometheus +SQL > + SELECT + '' AS workspace_id, + metric['name'] AS name, + metric['type'] AS type, + metric['help'] AS help, + toFloat64(metric['value']) AS value, + map( + 'organization_id', + organization_id, + 'region', + region, + 'product_code', + product_code, + 'usage_type', + usage_type, + 'operation', + operation, + 'currency', + currency, + 'product_name', + product_name, + 'service_name', + service_name, + 'product_family', + product_family, + 'type', + usage_category + ) AS labels + FROM + ( + SELECT + organization_id, + region, + product_code, + usage_type, + operation, + currency, + product_name, + service_name, + product_family, + type AS usage_category, + sum(usage_amount) AS usage_amount_total, + sum(cost) AS cost_total, + sum(blended_cost) AS blended_cost_total + FROM organization.private_link + GROUP BY + organization_id, + region, + product_code, + usage_type, + operation, + currency, + product_name, + service_name, + product_family, + usage_category + ) + ARRAY + JOIN + [ + map( + 'name', + 'private_link_usage_amount_total', + 'type', + 'counter', + 'help', + 'Total private link usage amount reported by the provider', + 'value', + toString(usage_amount_total) + ), + map( + 'name', + 'private_link_cost_total', + 'type', + 'counter', + 'help', + 'Total private link cost in the reported currency', + 'value', + toString(cost_total) + ), + map( + 'name', + 'private_link_blended_cost_total', + 'type', + 'counter', + 'help', + 'Total blended private link cost in the reported currency', + 'value', + toString(blended_cost_total) + ) + ] AS metric + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/requests.pipe b/tinybird/endpoints/requests.pipe index bf5f492..95b2fb6 100644 --- a/tinybird/endpoints/requests.pipe +++ b/tinybird/endpoints/requests.pipe @@ -214,7 +214,7 @@ SQL > metric_requests_total['type'] as type, metric_requests_total['help'] as help, toFloat64(metric_requests_total['value']) as value, - map('pipe', pipe_name) as labels + map('workspace_id', workspace_id, 'pipe', pipe_name) as labels FROM requests_totals_metrics UNION ALL SELECT @@ -223,8 +223,8 @@ SQL > metric_requests_5m['type'] as type, metric_requests_5m['help'] as help, toFloat64(metric_requests_5m['value']) as value, - map('pipe', pipe_name) as labels + map('workspace_id', workspace_id, 'pipe', pipe_name) as labels FROM requests_5m_metrics + ORDER BY name TYPE endpoint - diff --git a/tinybird/endpoints/sinks.pipe b/tinybird/endpoints/sinks.pipe new file mode 100644 index 0000000..0909bec --- /dev/null +++ b/tinybird/endpoints/sinks.pipe @@ -0,0 +1,119 @@ +DESCRIPTION > + Returns cumulative sink execution, error, duration, CPU, row, and byte metrics + from organization.sinks_ops_log, grouped by workspace, service, and Pipe. + +TOKEN "sinks_endpoint_read" READ + +NODE sinks_prometheus +SQL > + SELECT + workspace_id, + metric['name'] AS name, + metric['type'] AS type, + metric['help'] AS help, + toFloat64(metric['value']) AS value, + map('workspace_id', workspace_id, 'service', service, 'pipe', pipe_name) AS labels + FROM + ( + SELECT + workspace_id, + service, + pipe_name, + count() AS executions_total, + countIf(result != 'ok') AS errors_total, + sum(elapsed_time) AS elapsed_time_seconds_total, + sum(cpu_time) AS cpu_time_seconds_total, + sum(read_rows) AS read_rows_total, + sum(written_rows) AS written_rows_total, + sum(read_bytes) AS read_bytes_total, + sum(written_bytes) AS written_bytes_total + FROM organization.sinks_ops_log + GROUP BY workspace_id, service, pipe_name + ) + ARRAY + JOIN + [ + map( + 'name', + 'sinks_executions_total', + 'type', + 'counter', + 'help', + 'Total sink executions', + 'value', + toString(executions_total) + ), + map( + 'name', + 'sinks_errors_total', + 'type', + 'counter', + 'help', + 'Total failed sink executions', + 'value', + toString(errors_total) + ), + map( + 'name', + 'sinks_elapsed_time_seconds_total', + 'type', + 'counter', + 'help', + 'Total elapsed time spent executing sinks in seconds', + 'value', + toString(elapsed_time_seconds_total) + ), + map( + 'name', + 'sinks_cpu_time_seconds_total', + 'type', + 'counter', + 'help', + 'Total CPU time spent executing sinks in seconds', + 'value', + toString(cpu_time_seconds_total) + ), + map( + 'name', + 'sinks_read_rows_total', + 'type', + 'counter', + 'help', + 'Total rows read by sinks', + 'value', + toString(read_rows_total) + ), + map( + 'name', + 'sinks_written_rows_total', + 'type', + 'counter', + 'help', + 'Total rows written by sinks', + 'value', + toString(written_rows_total) + ), + map( + 'name', + 'sinks_read_bytes_total', + 'type', + 'counter', + 'help', + 'Total bytes read by sinks', + 'value', + toString(read_bytes_total) + ), + map( + 'name', + 'sinks_written_bytes_total', + 'type', + 'counter', + 'help', + 'Total bytes written by sinks', + 'value', + toString(written_bytes_total) + ) + ] AS metric + ORDER BY name + +TYPE ENDPOINT diff --git a/tinybird/endpoints/storage.pipe b/tinybird/endpoints/storage.pipe index 729c133..424fb47 100644 --- a/tinybird/endpoints/storage.pipe +++ b/tinybird/endpoints/storage.pipe @@ -89,7 +89,8 @@ SQL > metric['type'] as type, metric['help'] as help, toFloat64(metric['value']) as value, - map('datasource', datasource_name) as labels + map('workspace_id', workspace_id, 'datasource', datasource_name) as labels FROM storage_metrics + ORDER BY name TYPE endpoint