Openstatus www.openstatus.dev

fix: public monitors region (#1342)

authored by

Maximilian Kaske and committed by
GitHub
192efbd8 41807c47

+22 -2
+6 -1
apps/web/src/app/status-page/[domain]/monitors/[id]/page.tsx
··· 75 75 const minutes = isQuantileDisabled ? periodicityMinutes : intervalMinutes; 76 76 77 77 const [metrics, data, metricsByRegion] = await Promise.all([ 78 - prepareMetricsByPeriod(period, type).getData({ monitorId: id }), 78 + prepareMetricsByPeriod(period, type).getData({ 79 + monitorId: id, 80 + regions: monitor.regions, 81 + }), 79 82 prepareMetricByIntervalByPeriod(period, type).getData({ 80 83 monitorId: id, 81 84 interval: minutes, 85 + regions: monitor.regions, 82 86 }), 83 87 prepareMetricByRegionByPeriod(period, type).getData({ 84 88 monitorId: id, 89 + regions: monitor.regions, 85 90 }), 86 91 ]); 87 92
+16 -1
packages/tinybird/src/client.ts
··· 20 20 if (process.env.NODE_ENV === "development") { 21 21 this.tb = new NoopTinybird(); 22 22 } else { 23 + this.tb = new Client({ token }); 23 24 } 24 - this.tb = new Client({ token }); 25 25 } 26 26 27 27 public get homeStats() { ··· 184 184 return this.tb.buildPipe({ 185 185 pipe: "endpoint__http_metrics_1d__v0", 186 186 parameters: z.object({ 187 + regions: z.array(z.enum(flyRegions)).optional(), 187 188 interval: z.number().int().optional(), 188 189 monitorId: z.string(), 189 190 }), ··· 229 230 return this.tb.buildPipe({ 230 231 pipe: "endpoint__http_metrics_7d__v0", 231 232 parameters: z.object({ 233 + regions: z.array(z.enum(flyRegions)).optional(), 232 234 interval: z.number().int().optional(), 233 235 monitorId: z.string(), 234 236 }), ··· 274 276 return this.tb.buildPipe({ 275 277 pipe: "endpoint__http_metrics_14d__v0", 276 278 parameters: z.object({ 279 + regions: z.array(z.enum(flyRegions)).optional(), 277 280 interval: z.number().int().optional(), 278 281 monitorId: z.string(), 279 282 }), ··· 380 383 pipe: "endpoint__http_metrics_by_region_1d__v0", 381 384 parameters: z.object({ 382 385 monitorId: z.string(), 386 + regions: z.array(z.enum(flyRegions)).optional(), 383 387 }), 384 388 data: z.object({ 385 389 region: z.enum(flyRegions), ··· 400 404 pipe: "endpoint__http_metrics_by_region_7d__v0", 401 405 parameters: z.object({ 402 406 monitorId: z.string(), 407 + regions: z.array(z.enum(flyRegions)).optional(), 403 408 }), 404 409 data: z.object({ 405 410 region: z.enum(flyRegions), ··· 420 425 pipe: "endpoint__http_metrics_by_region_14d__v0", 421 426 parameters: z.object({ 422 427 monitorId: z.string(), 428 + regions: z.array(z.enum(flyRegions)).optional(), 423 429 }), 424 430 data: z.object({ 425 431 region: z.enum(flyRegions), ··· 703 709 return this.tb.buildPipe({ 704 710 pipe: "endpoint__tcp_metrics_1d__v0", 705 711 parameters: z.object({ 712 + regions: z.array(z.enum(flyRegions)).optional(), 706 713 interval: z.number().int().optional(), 707 714 monitorId: z.string(), 708 715 }), ··· 749 756 pipe: "endpoint__tcp_metrics_7d__v0", 750 757 parameters: z.object({ 751 758 interval: z.number().int().optional(), 759 + regions: z.array(z.enum(flyRegions)).optional(), 752 760 monitorId: z.string(), 753 761 }), 754 762 data: z.object({ ··· 793 801 return this.tb.buildPipe({ 794 802 pipe: "endpoint__tcp_metrics_14d__v0", 795 803 parameters: z.object({ 804 + regions: z.array(z.enum(flyRegions)).optional(), 796 805 interval: z.number().int().optional(), 797 806 monitorId: z.string(), 798 807 }), ··· 838 847 return this.tb.buildPipe({ 839 848 pipe: "endpoint__tcp_metrics_by_interval_1d__v0", 840 849 parameters: z.object({ 850 + regions: z.array(z.enum(flyRegions)).optional(), 841 851 interval: z.number().int().optional(), 842 852 monitorId: z.string(), 843 853 }), ··· 858 868 return this.tb.buildPipe({ 859 869 pipe: "endpoint__tcp_metrics_by_interval_7d__v0", 860 870 parameters: z.object({ 871 + regions: z.array(z.enum(flyRegions)).optional(), 861 872 interval: z.number().int().optional(), 862 873 monitorId: z.string(), 863 874 }), ··· 878 889 return this.tb.buildPipe({ 879 890 pipe: "endpoint__tcp_metrics_by_interval_14d__v0", 880 891 parameters: z.object({ 892 + regions: z.array(z.enum(flyRegions)).optional(), 881 893 interval: z.number().int().optional(), 882 894 monitorId: z.string(), 883 895 }), ··· 899 911 pipe: "endpoint__tcp_metrics_by_region_1d__v0", 900 912 parameters: z.object({ 901 913 monitorId: z.string(), 914 + regions: z.array(z.enum(flyRegions)).optional(), 902 915 }), 903 916 data: z.object({ 904 917 region: z.enum(flyRegions), ··· 919 932 pipe: "endpoint__tcp_metrics_by_region_7d__v0", 920 933 parameters: z.object({ 921 934 monitorId: z.string(), 935 + regions: z.array(z.enum(flyRegions)).optional(), 922 936 }), 923 937 data: z.object({ 924 938 region: z.enum(flyRegions), ··· 939 953 pipe: "endpoint__tcp_metrics_by_region_14d__v0", 940 954 parameters: z.object({ 941 955 monitorId: z.string(), 956 + regions: z.array(z.enum(flyRegions)).optional(), 942 957 }), 943 958 data: z.object({ 944 959 region: z.enum(flyRegions),