Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
Docs email update (#1918)
Thibault Le Ouaya00bfa66a6b5
diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjsindex e73b65432..5ebcc4bae 100644--- a/apps/docs/astro.config.mjs+++ b/apps/docs/astro.config.mjs@@ -13,6 +13,9 @@ export default defineConfig({site: "https://docs.openstatus.dev",vite: {plugins: [Icons({ compiler: "astro" }), tailwindcss()],+ ssr: {+ noExternal: ["zod"],+ },},env: {schema: {@@ -237,15 +240,15 @@ export default defineConfig({},],plugins: [+ starlightLinksValidator({+ errorOnLocalLinks: false,+ }),starlightLlmsTxt({projectName: "openstatus docs",description:"openstatus is an open-source global uptime monitoring platform that offers a status page and monitoring as code.",}),starlightImageZoom(),- starlightLinksValidator({- errorOnLocalLinks: false,- }),],}),],diff --git a/apps/docs/src/content/docs/404.md b/apps/docs/src/content/docs/404.mdnew file mode 100644index 000000000..75e5eadd3--- /dev/null+++ b/apps/docs/src/content/docs/404.md@@ -0,0 +1,12 @@+---+title: Not Found+template: splash+editUrl: false+hero:+ tagline: This page could not be found.+ actions: []+pagefind: false+sidebar:+ hidden: true+draft: false+---diff --git a/apps/docs/src/content/docs/concept/latency-vs-response-time.mdx b/apps/docs/src/content/docs/concept/latency-vs-response-time.mdxindex 968d62877..2a1476e36 100644--- a/apps/docs/src/content/docs/concept/latency-vs-response-time.mdx+++ b/apps/docs/src/content/docs/concept/latency-vs-response-time.mdx@@ -122,5 +122,4 @@ openstatus monitors and displays:- **[Create your first monitor](/tutorial/how-to-create-monitor)** - Start tracking these metrics- **[Understanding uptime monitoring](/concept/uptime-monitoring)** - Broader monitoring concepts-- **[Monitor data collected](/monitoring/monitor-data-collected)** - All metrics we track- **[HTTP monitor reference](/reference/http-monitor)** - Technical specificationsdiff --git a/apps/docs/src/content/docs/guides/how-to-monitor-mcp-server.mdx b/apps/docs/src/content/docs/guides/how-to-monitor-mcp-server.mdxindex 9dc4f7517..30c252e00 100644--- a/apps/docs/src/content/docs/guides/how-to-monitor-mcp-server.mdx+++ b/apps/docs/src/content/docs/guides/how-to-monitor-mcp-server.mdx@@ -125,7 +125,7 @@ This guide has equipped you with the knowledge to effectively monitor your MCP sNow that your MCP server is under robust monitoring, consider further enhancing your setup:-- **[Set up Alerting](/monitoring/customization/notification)**: Configure notifications to be immediately informed of any MCP server downtime or performance degradation.+- **[Export Metrics to OTLP](/guides/how-to-export-metrics-to-otlp-endpoint)**: Integrate your MCP monitoring data with your existing observability platform for centralized analytics.- **[Run Synthetic Tests in GitHub Actions](/guides/how-to-run-synthetic-test-github-action/)**: Incorporate these synthetic checks into your CI/CD pipeline for pre-deployment validation.diff --git a/apps/docs/src/content/docs/guides/self-hosting-openstatus.mdx b/apps/docs/src/content/docs/guides/self-hosting-openstatus.mdxindex bb6f49e05..d3cbad5bd 100644--- a/apps/docs/src/content/docs/guides/self-hosting-openstatus.mdx+++ b/apps/docs/src/content/docs/guides/self-hosting-openstatus.mdx@@ -179,7 +179,6 @@ Congratulations! You've successfully:- **[Deploy Private Locations](/guides/how-to-deploy-probes-cloudflare-containers)** - Set up monitoring from multiple regions- **[Create Monitors](/tutorial/how-to-create-monitor)** - Start monitoring your services-- **[Configure Notifications](/monitoring/customization/notification)** - Get alerted on issues## Additional resourcesdiff --git a/apps/docs/src/content/docs/monitoring/clone-monitor.mdx b/apps/docs/src/content/docs/monitoring/clone-monitor.mdxdeleted file mode 100644index 4e9cc0328..000000000--- a/apps/docs/src/content/docs/monitoring/clone-monitor.mdx+++ /dev/null@@ -1,17 +0,0 @@-----title: How to clone a monitor?-description: "How to clone a monitor with openstatus"------import { Image } from 'astro:assets';-import monitorDetail from '../../../assets/monitor/clone-monitor.png';---Go to the **Monitors** page, click on three dots and the select the **Clone** button. This will create a new monitor with the same settings as the original monitor (including Status Page, Notifications and Tags).--By default, the cloned monitor will be in the **inactive** state to allow you to review the settings before activating it.-- <Image- src={monitorDetail}- alt="Charts with status code and response time"- />diff --git a/apps/docs/src/content/docs/monitoring/customization/assertions.mdx b/apps/docs/src/content/docs/monitoring/customization/assertions.mdxdeleted file mode 100644index 35a6977d4..000000000--- a/apps/docs/src/content/docs/monitoring/customization/assertions.mdx+++ /dev/null@@ -1,40 +0,0 @@-----title: Assertions-description: "How to set up assertions for your synthetic checks in openstatus"-------import { Image } from 'astro:assets';--import Assertions from '../../../../assets/monitor/assertions.png';-- <Image- src={Assertions}- alt="Monitor assertions"- />----By default we expect the endpoint to return a `200` status code. If you want to check for a different status code you can go to to the `Assertions` tab and add a new assertion.--We support **status code**, **header** and **body string** assertions.--To change assertions for your monitors: _Select a monitor → Settings → Timing & Assertions_.--### Status Code Assertions--Define the **status code** you want to check for.--Supports `Equal`, `Not equal`, `Greater than`, `Less than`, `Greater than or equal`, `Less than or equal` assertions.--### Header Assertions--Define the **header** you want to check for.--Supports `Equal`, `Not equal`, `Contains`, `Does not Contain`, `Empty`, `Not empty`, `Greater than`, `Less than`, `Greater than or equal`, `Less than or equal` assertions.--### Body String Assertions--Define the **body string** you want to check for.--Supports `Equal`, `Not equal`, `Contains`, `Does not Contain`, `Empty`, `Not empty`, `Greater than`, `Less than`, `Greater than or equal`, `Less than or equal` assertions.diff --git a/apps/docs/src/content/docs/monitoring/customization/follow-redirects.mdx b/apps/docs/src/content/docs/monitoring/customization/follow-redirects.mdxdeleted file mode 100644index 85f28ae51..000000000--- a/apps/docs/src/content/docs/monitoring/customization/follow-redirects.mdx+++ /dev/null@@ -1,12 +0,0 @@-----title: Follow Redirects-description: "What are follow redirects on a monitor in openstatus"------The Follow Redirects option controls whether your monitor should automatically follow HTTP redirects. **By default, we follow the redirects.**--When enabled, the monitor will follow any `3xx` redirect responses (e.g. `301 Moved Permanently`, `302 Found`) until it reaches the final destination URL. The monitor will then report the status of the final response.--Enable this option if:-- You are monitoring a URL that often redirects (e.g. from http:// to https://, or from a short link to the final page).-- You want to verify that the final destination is available and returns the expected response.diff --git a/apps/docs/src/content/docs/monitoring/customization/frequency.mdx b/apps/docs/src/content/docs/monitoring/customization/frequency.mdxdeleted file mode 100644index 7f1ee48a1..000000000--- a/apps/docs/src/content/docs/monitoring/customization/frequency.mdx+++ /dev/null@@ -1,19 +0,0 @@-----title: Frequency-description: "How to change the frequency of your synthetic checks in openstatus"------By default, openstatus.dev will check your service every 30 minutes.--The min frequency options range from 10 minutes for free plans to 30 seconds for paid plans.--To change frequency of your monitors: _Select a monitor → Settings → Scheduling & Regions_.--We support the following frequencies:--- Every 30 seconds-- Every 1 minute-- Every 5 minutes-- Every 10 minutes-- Every 30 minutes-- Every 1 hourdiff --git a/apps/docs/src/content/docs/monitoring/customization/locations.mdx b/apps/docs/src/content/docs/monitoring/customization/locations.mdxdeleted file mode 100644index 3713f303a..000000000--- a/apps/docs/src/content/docs/monitoring/customization/locations.mdx+++ /dev/null@@ -1,71 +0,0 @@-----title: Locations-description: "How to change the locations for your synthetic checks in openstatus"-------We have multiple locations around the world to monitor your services. You can choose from public locations or use private locations that you own and manage.--## Public Locations--For free users, openstatus will monitor your service from six location, one on every continent. For paid users, you can choose from multiple locations around the world to monitor your service.---To change regions for your monitors: _Select a monitor → Settings → Scheduling & Regions_.--Africa--- Johannesburg, South Africa ๐ฟ๐ฆ (free)--Asia--- Hong Kong, Hong Kong ๐ญ๐ฐ (free)-- Mumbai, India ๐ฎ๐ณ-- Singapore, Singapore ๐ธ๐ฌ-- Tokyo, Japan ๐ฏ๐ต--Europe--- Amsterdam, Netherlands ๐ณ๐ฑ (free)-- Bucharest, Romania ๐ท๐ด-- Frankfurt, Germany ๐ฉ๐ช-- London, United Kingdom ๐ฌ๐ง-- Madrid, Spain ๐ช๐ธ-- Paris, France ๐ซ๐ท-- Stockholm, Sweden ๐ธ๐ช-- Warsaw, Poland ๐ต๐ฑ--North America--- Ashburn, Virginia, USA ๐บ๐ธ (free)-- Atlanta, Georgia, USA ๐บ๐ธ-- Boston, Massachusetts, USA ๐บ๐ธ-- Chicago, Illinois, USA ๐บ๐ธ-- Dallas, Texas, USA ๐บ๐ธ-- Denver, Colorado, USA ๐บ๐ธ-- Guadalajara, Mexico ๐ฒ๐ฝ-- Los Angeles, California, USA ๐บ๐ธ-- Miami, Florida, USA ๐บ๐ธ-- Montreal, Canada ๐จ๐ฆ-- Phoenix, Arizona, USA ๐บ๐ธ-- Queretaro, Mexico ๐ฒ๐ฝ-- Seattle, Washington, USA ๐บ๐ธ-- San Jose, California, USA ๐บ๐ธ-- Toronto, Canada ๐จ๐ฆ--South America--- Bogota, Colombia ๐จ๐ด-- Buenos Aires, Argentina ๐ฆ๐ท-- Rio de Janeiro, Brazil ๐ง๐ท-- Sao Paulo, Brazil ๐ง๐ท (free)-- Santiago, Chile ๐จ๐ฑ--Oceania--- Sydney, Australia ๐ฆ๐บ (free)---## Private Locations--You can also use private locations to monitor your services. Private locations are servers that you own and manage. If you want to use private locations, you can learn how to set them up in our [How to create a private location (beta)](/tutorial/how-to-create-private-location) guide.diff --git a/apps/docs/src/content/docs/monitoring/customization/notification.mdx b/apps/docs/src/content/docs/monitoring/customization/notification.mdxdeleted file mode 100644index 14f2a715b..000000000--- a/apps/docs/src/content/docs/monitoring/customization/notification.mdx+++ /dev/null@@ -1,26 +0,0 @@-----title: Notifications-description: "How to set up notifications for your synthetic checks in openstatus"-----import { Image } from 'astro:assets';-import { Aside} from '@astrojs/starlight/components';--import Notification from '../../../../assets/monitor/notifications.png';-- <Image- src={Notification}- alt="Monitor notifications"- />---If you want to receive notifications when your monitor fails, you can connect it to a notification channel.--To connect your monitor to a notification channel, _Select a monitor → Settings → Notifications_.--You will have the list of available notification channels. You can connect your monitor to one or multiple notification channels.--You need to create a notification channel before connecting your monitor to it.--<Aside>-By default your monitor won't send any notification on failure. You can enable notifications for your monitor by connecting it to a notification channel.-</Aside>diff --git a/apps/docs/src/content/docs/monitoring/customization/timing.mdx b/apps/docs/src/content/docs/monitoring/customization/timing.mdxdeleted file mode 100644index c35d5c7e8..000000000--- a/apps/docs/src/content/docs/monitoring/customization/timing.mdx+++ /dev/null@@ -1,10 +0,0 @@-----title: Timing-description: "How to set up timing threshold for your synthetic checks in openstatus"------By default, openstatus will timeout after `45s` but you can set a custom timeout (max. `45s`).--You can also set a custom degraded threshold. If the response time is higher than the degraded threshold, the status will be set to `Degraded` and we will send a notification.--To change assertions for your monitors: _Select a monitor → Settings → Timing & Assertions_.diff --git a/apps/docs/src/content/docs/monitoring/group-monitor-tag.mdx b/apps/docs/src/content/docs/monitoring/group-monitor-tag.mdxdeleted file mode 100644index 5f7e4075b..000000000--- a/apps/docs/src/content/docs/monitoring/group-monitor-tag.mdx+++ /dev/null@@ -1,30 +0,0 @@-----title: How to group your monitors-description: "How to group your monitors in openstatus to manage them more efficiently"------import { Image } from 'astro:assets';--import createTag from '../../../assets/monitor/create-tag.png'-import filterTag from '../../../assets/monitor/filter-tag.png'--If you have multiple monitors that you want to group together, you can do so by creating a tag. Tags help you organize your monitors and manage them more efficiently.--### Create a tag--You can create a tag by going to settings tab of your monitor and adding a new tag.-- <Image- src={createTag}- alt="openstatus create monitor tag"- />---### Filter monitors by Tags--Once you have created tags, you can filter your monitors by tags. This helps you to quickly find the monitors you are looking for.-- <Image- src={filterTag}- alt="openstatus filter by tag"- />diff --git a/apps/docs/src/content/docs/monitoring/monitor-data-collected.mdx b/apps/docs/src/content/docs/monitoring/monitor-data-collected.mdxdeleted file mode 100644index 43113ba4f..000000000--- a/apps/docs/src/content/docs/monitoring/monitor-data-collected.mdx+++ /dev/null@@ -1,62 +0,0 @@-----title: Monitor Data Points-description: "Monitor metrics are the data points that are collected by the monitor during the check in openstatus."------import { Image } from 'astro:assets';--import ResponseLog from '../../../assets/monitor/response-log.png';-import ResponseLogHeader from '../../../assets/monitor/response-log-header.png';-import ResponseLogTiming from '../../../assets/monitor/response-log-timing.png';---## Access Monitor Data Points--To view your monitor data points, navigate to the monitor details page and click on the `Response` tab.---- <Image- src={ResponseLog}- alt="openstatus response log"- />---## Monitor Data Points--These are the data points that are collected by the monitor during the check.-----### HTTP Monitor Metrics-- <Image- src={ResponseLogHeader}- alt="openstatus response log"- />---For an HTTP monitor, the following metrics are collected:-- **Status Code**: The HTTP status code returned by the server.-- **Response Time**: The time taken by the server to respond to the request.-- **Response Size**: The size of the response body.-- **Response Headers**: The headers returned by the server.-- **Response Body**: The body of the response in case of error-- **DNS timing**: The time taken to resolve the domain name.-- **TCP timing**: The time taken to establish a TCP connection.-- **TLS timing**: The time taken to establish a TLS connection.-- **TTFB timing**: Time to first byte, the time taken to receive the first byte of the response.-- **Transfer timing**: The time taken to download the response body.--- <Image- src={ResponseLogTiming}- alt="openstatus response log timing"- />--### TCP Monitor Metrics--For a TCP monitor, the following metrics are collected:-- **Response Time**: The time taken by the server to respond to the request.-- **TCP timing**: The time taken to establish a TCP connection.diff --git a/apps/docs/src/content/docs/monitoring/monitoring-as-code.mdx b/apps/docs/src/content/docs/monitoring/monitoring-as-code.mdxdeleted file mode 100644index 08fdda86a..000000000--- a/apps/docs/src/content/docs/monitoring/monitoring-as-code.mdx+++ /dev/null@@ -1,84 +0,0 @@-----title: Monitoring as Code-description: "How to manage monitors as code with openstatus?"------## Introduction--Monitoring as code is a practice that allows you to define and manage your monitoring configurations using code. This approach provides several benefits, including:--- **Version control**: You can track changes to your monitoring configurations using version control systems like Git.-- **Reproducibility**: Your monitoring configurations can be easily reproduced across environments.-- **Automation**: You can automate the deployment and management of your monitoring configurations using tools like CI/CD pipelines.---## Getting Started--openstatus provides a [CLI](/tutorial/get-started-with-openstatus-cli) tool that allows you to create, update, and delete monitors as code. To get started, you need to install the CLI tool.--## Examples--### Uptime Monitoring--```yaml-# yaml-language-server: $schema=https://www.openstatus.dev/schema.json-uptime-monitor:- name: "Uptime Monitor"- description: "Uptime monitoring example"- frequency: "10m"- active: true- regions:- - iad- - ams- - syd- - jnb- - gru- retry: 3- kind: http- request:- url: https://openstat.us- method: GET- headers:- User-Agent: openstatus- assertions:- - kind: statusCode- compare: eq- target: 200-```--#### Monitoring a MCP Server:--```yaml-# yaml-language-server: $schema=https://www.openstatus.dev/schema.json--mcp-server:- name: "HF MCP Server "- description: "Hugging Face MCP server monitoring"- frequency: "1m"- active: true- regions: ["iad", "ams", "lax"]- retry: 3- kind: http- request:- url: https://hf.co/mcp- method: POST- body: >- {- "jsonrpc": "2.0",- "id": "openstatus",- "method": "ping"- }- headers:- User-Agent: openstatus- Accept: application/json, text/event-stream- Content-Type: application/json- assertions:- - kind: statusCode- compare: eq- target: 200- - kind: textBody- compare: eq- target: '{"result":{},"jsonrpc":"2.0","id":"openstatus"}'-```--You can find more examples in the [openstatus Template GitHub repository](https://github.com/openstatusHQ/cli-template/).diff --git a/apps/docs/src/content/docs/monitoring/opentelemetry.mdx b/apps/docs/src/content/docs/monitoring/opentelemetry.mdxdeleted file mode 100644index fcff74ff0..000000000--- a/apps/docs/src/content/docs/monitoring/opentelemetry.mdx+++ /dev/null@@ -1,57 +0,0 @@-----title: OpenTelemetry-description: "How to export your synthetic monitoring data to your observability platform with openstatus"-----import { Aside } from '@astrojs/starlight/components';--<Aside>- This feature is available for Pro plan users and above.-</Aside>----## How to export your synthetic monitoring data to your observability stack with openstatus---openstatus supports exporting your synthetic monitoring data to your observability platform using OpenTelemetry.--When you enable this feature, we will export the results of the synthetic checks as metrics.---You can send your metrics to:-- [How to send data to Grafana Cloud](https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/)-- [How to send data to New Relic](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/)-- [How to send data to Honeycomb](https://docs.honeycomb.io/send-data/opentelemetry/collector/)-- Signoz---#### Grafana Cloud Example---[openstatus X Grafana Public dashboard](https://openstatus.grafana.net/public-dashboards/a85806536e9243f7ab9e0d458eb2ad32)--### How to setup?--To change set up an otlp endpont : _Select a monitor → Settings → OTel_.--Add your OTLP endpoint and include your headers.---#### Attributes--- openstatus.probes -> the region of the probes-- openstatus.target-#### Available Metrics--For HTTP probes:-- openstatus.http.request.duration-- openstatus.http.dns.duration-- openstatus.http.connection.duration-- openstatus.http.tls.duration-- openstatus.http.ttfb.duration-- openstatus.http.transfer.duration-- openstatus.error ( counter fill when error)-- openstatus.status (counter -> 1 when successful request)--For TCP probes:-- openstatus.tcp.request.durationdiff --git a/apps/docs/src/content/docs/monitoring/overview.mdx b/apps/docs/src/content/docs/monitoring/overview.mdxindex b7ba5fb77..3612b8616 100644--- a/apps/docs/src/content/docs/monitoring/overview.mdx+++ b/apps/docs/src/content/docs/monitoring/overview.mdx@@ -40,35 +40,20 @@ You can create a new monitor in one of four ways:- Dashboard: Use our intuitive dashboard to quickly set up and manage your monitors.- API: Integrate monitor creation into your workflow using our [API](https://api.openstatus.dev/v1#tag/monitor/POST/monitor).- CLI: Use our command-line interface to create and manage monitors with [YAML configuration files](https://github.com/openstatusHQ/cli-template).-- Terraform: Automate the process with our [Terraform provider](/tools/terraform).+- Terraform: Automate the process with our [Terraform provider](/reference/terraform/).### Monitor types-We support different types of monitors for various use cases:--<CardGrid>- <LinkCard- title="HTTP Monitor"- href="/monitoring/type/http"- description="Monitor HTTP/HTTPS endpoints including APIs and websites"- />- <LinkCard- title="TCP Monitor"- href="/monitoring/type/tcp"- description="Monitor TCP port availability for databases and services"- />-</CardGrid>+- **HTTP**: Check the availability and performance of your web services by sending HTTP requests and analyzing the responses.+- **TCP**: Verify that your servers are accepting connections on specific ports, ensuring that critical+- **DNS**: Monitor the health of your DNS records by performing lookups and validating responses.## Getting startedReady to start monitoring? Follow these guides:1. **[Create Your First Monitor](/tutorial/how-to-create-monitor)** - Step-by-step tutorial-2. **[Configure Notifications](/monitoring/customization/notification)** - Get alerted on issues-3. **[Set Up Assertions](/monitoring/customization/assertions)** - Validate response content## Learn more- **[Understanding Uptime Monitoring](/concept/uptime-monitoring)** - Core concepts explained-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - What metrics we track-- **[Monitoring as Code](/monitoring/monitoring-as-code)** - Manage monitors with YAMLdiff --git a/apps/docs/src/content/docs/monitoring/type/http.mdx b/apps/docs/src/content/docs/monitoring/type/http.mdxdeleted file mode 100644index 24ddcad90..000000000--- a/apps/docs/src/content/docs/monitoring/type/http.mdx+++ /dev/null@@ -1,38 +0,0 @@-----title: HTTP-description: "How to monitor your HTTP services with openstatus"-----import { Image } from 'astro:assets';--import HttpMonitor from '../../../../assets/monitor/http-monitor.png';-- <Image- src={HttpMonitor}- alt="Http Monitor"- />----### URL--Enter the URL of your service that you want to monitor. You can also add a path and query parameters to the URL.--### Methods--Following HTTP methods are supported:--- `GET`-- `POST`-- `HEAD`--Let us know if you need more methods to support at [email protected].--### Headers--If you need to set custom headers for your HTTP requests, you can do so by going to the `Headers` tab and adding a new header.--### Body Payload--When you select the `POST` method, you can add a body payload to your request. This is useful when you need to send data to your service.--Payloads are often JSON or XML, but we also support plain text or binary files.diff --git a/apps/docs/src/content/docs/monitoring/type/tcp.mdx b/apps/docs/src/content/docs/monitoring/type/tcp.mdxdeleted file mode 100644index 6aae63cbc..000000000--- a/apps/docs/src/content/docs/monitoring/type/tcp.mdx+++ /dev/null@@ -1,18 +0,0 @@-----title: TCP-description: "How to monitor your TCP services with openstatus"------import { Image } from 'astro:assets';--import TCPMonitor from '../../../../assets/monitor/tcp-monitor.png';-- <Image- src={TCPMonitor}- alt="TCP Monitor"- />----### URI (Host:Port)-Provide your Host and Port to monitor your TCP service. Could be a domain or IPv4/IPv6 address.diff --git a/apps/docs/src/content/docs/reference/dns-monitor.mdx b/apps/docs/src/content/docs/reference/dns-monitor.mdxindex bc685ff0c..2a02654c8 100644--- a/apps/docs/src/content/docs/reference/dns-monitor.mdx+++ b/apps/docs/src/content/docs/reference/dns-monitor.mdx@@ -128,6 +128,4 @@ The number of times the monitor will retry a failed DNS lookup before reporting## Related resources-- **[Monitoring Overview](/monitoring/overview)** - Conceptual overview of monitoring within OpenStatus.-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - Details on all metrics collected by monitors.- **[CLI Reference](/reference/cli-reference)** - Manage monitors as code using the OpenStatus CLI.diff --git a/apps/docs/src/content/docs/reference/http-monitor.mdx b/apps/docs/src/content/docs/reference/http-monitor.mdxindex 7fad568fc..ac8339da5 100644--- a/apps/docs/src/content/docs/reference/http-monitor.mdx+++ b/apps/docs/src/content/docs/reference/http-monitor.mdx@@ -273,6 +273,4 @@ Controls the visibility of monitor data on your public status page.## Related resources- **[Create Your First Monitor](/tutorial/how-to-create-monitor)** - Step-by-step tutorial on setting up a monitor.-- **[Monitoring Overview](/monitoring/overview)** - Conceptual overview of OpenStatus monitoring capabilities.-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - Detailed information on all metrics and data points collected by monitors.- **[CLI Reference](/reference/cli-reference)** - Guide to managing OpenStatus monitors programmatically using the command-line interface.diff --git a/apps/docs/src/content/docs/reference/incident.mdx b/apps/docs/src/content/docs/reference/incident.mdxindex cebe7b5b6..c1a998812 100644--- a/apps/docs/src/content/docs/reference/incident.mdx+++ b/apps/docs/src/content/docs/reference/incident.mdx@@ -41,5 +41,3 @@ While an incident is active, it collects and displays key information related to## Related resources- **[Status Report Reference](/reference/status-report)** - Details on how incident statuses are managed and reported.-- **[Monitoring Overview](/monitoring/overview)** - Conceptual overview of monitoring within OpenStatus.-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - All tracked metrics collected by monitors.diff --git a/apps/docs/src/content/docs/reference/notification.mdx b/apps/docs/src/content/docs/reference/notification.mdxindex b05da6544..a920cc310 100644--- a/apps/docs/src/content/docs/reference/notification.mdx+++ b/apps/docs/src/content/docs/reference/notification.mdx@@ -194,5 +194,4 @@ Sends notifications to an Ntfy topic.## Related resources-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - Details on all metrics collected by monitors.- **[Incident Reference](/reference/incident)** - Information about incident creation and management.diff --git a/apps/docs/src/content/docs/reference/private-location.mdx b/apps/docs/src/content/docs/reference/private-location.mdxindex 5e84bc935..f90b144c1 100644--- a/apps/docs/src/content/docs/reference/private-location.mdx+++ b/apps/docs/src/content/docs/reference/private-location.mdx@@ -39,5 +39,4 @@ Detailed steps for setting up a private location involve:## Related resources- **[How to Deploy Probes on Cloudflare Containers](/guides/how-to-deploy-probes-cloudflare-containers)** - A guide for deploying private probes using Cloudflare Workers/Containers. (Example deployment guide)-- **[Monitoring Overview](/monitoring/overview)** - Conceptual overview of monitoring within OpenStatus.- **[CLI Reference](/reference/cli-reference)** - Manage monitors as code, including those utilizing private locations.diff --git a/apps/docs/src/content/docs/reference/tcp-monitor.mdx b/apps/docs/src/content/docs/reference/tcp-monitor.mdxindex b47fa78d7..c2503bffe 100644--- a/apps/docs/src/content/docs/reference/tcp-monitor.mdx+++ b/apps/docs/src/content/docs/reference/tcp-monitor.mdx@@ -146,6 +146,4 @@ Authorization: Bearer <your_token>## Related resources- **[Create Your First Monitor](/tutorial/how-to-create-monitor)** - Step-by-step tutorial on setting up a monitor.-- **[Monitoring Overview](/monitoring/overview)** - Conceptual overview of OpenStatus monitoring capabilities.-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - Detailed information on all metrics and data points collected by monitors.- **[CLI Reference](/reference/cli-reference)** - Guide to managing OpenStatus monitors programmatically using the command-line interface.diff --git a/apps/docs/src/content/docs/reference/terraform.mdx b/apps/docs/src/content/docs/reference/terraform.mdxindex 5054ea529..8f079ec61 100644--- a/apps/docs/src/content/docs/reference/terraform.mdx+++ b/apps/docs/src/content/docs/reference/terraform.mdx@@ -120,7 +120,6 @@ resource "openstatus_monitor" "database_port_monitor" {## Related resources-- **[OpenStatus Monitoring Overview](/monitoring/overview)** - Learn more about monitoring concepts in OpenStatus.- **[HTTP Monitor Reference](/reference/http-monitor)** - Detailed specification for HTTP monitor configuration.- **[TCP Monitor Reference](/reference/tcp-monitor)** - Detailed specification for TCP monitor configuration.- **[DNS Monitor Reference](/reference/dns-monitor)** - Detailed specification for DNS monitor configuration.diff --git a/apps/docs/src/content/docs/tools/react.mdx b/apps/docs/src/content/docs/tools/react.mdxdeleted file mode 100644index 2cf0c37e4..000000000--- a/apps/docs/src/content/docs/tools/react.mdx+++ /dev/null@@ -1,73 +0,0 @@-----title: React Widget-description: "How to add a public status widget to your website."------Install the [npm](https://www.npmjs.com/package/@openstatus/react) package:--```bash-npm install @openstatus/react-```--## React Server Component--```tsx-import { StatusWidget } from "@openstatus/react";--export function Page() {- return <StatusWidget slug="status" />;-}-```--It will automatically attach the slug to the href to allow the user to open a-new tab on click to `https://slug.openstatus.dev`. If you want to redirect him-to a specific page, use the `href` property, like so:--```tsx-<StatusWidget slug="documenso" href="https://status.documenso.com" />-```--> `StatusWidget` is an **async function** and will only work with RSC. Using it-> within a dead simple React App will not work.--### Styling--#### With tailwindcss--```ts-// tailwind.config.js-module.exports = {- content: [- "./app/**/*.{tsx,ts,mdx,md}",- "./node_modules/@openstatus/react/**/*.{js,ts,jsx,tsx}",- ],- theme: {- extend: {},- },- plugins: [],-};-```--#### Without tailwindcss--```tsx-// app/layout.tsx-import "@openstatus/react/dist/styles.css";-```--## Typed fetch function--```tsx-import { getStatus } from "@openstatus/react";--// React Server Component-async function CustomStatusWidget() {- const res = await getStatus("slug");- // ^StatusResponse = { status: Status }-- const { status } = res;- // ^Status = "unknown" | "operational" | "degraded_performance" | "partial_outage" | "major_outage" | "under_maintenance" | "incident"-- return <div>{/* customize */}</div>;-}-```diff --git a/apps/docs/src/content/docs/tools/status-badge.mdx b/apps/docs/src/content/docs/tools/status-badge.mdxdeleted file mode 100644index 34cad2b75..000000000--- a/apps/docs/src/content/docs/tools/status-badge.mdx+++ /dev/null@@ -1,81 +0,0 @@-----title: Status Badge-description: "Easily embed a badge into your website"------## PNG Badge--```html-<img src='https://[slug].openstatus.dev/badge'>-```--This will return a PNG image with the status of your page. It will look like this:-<img src='https://status.openstatus.dev/badge' />--You can customize the theme by adding `?theme=dark` and the size of it by adding `?size=lg`.--Supported themes:-- `dark`-- `light` (default)--Supported sizes:-- `sm` (default)-- `md`-- `lg`-- `xl`--It will display the following labels based on the current status of the status page:--```-Operational-Degraded-Outage-Incident-Maintenance-Unknown-```--## SVG Badge (v2)--```html-<img src='https://[slug].openstatus.dev/badge/v2'>-```--This will return a PNG image with the status of your page. It will look like this:-<img src='https://status.openstatus.dev/badge/v2' />--You can customize the theme by adding `?theme=dark`, the size of it by adding `?size=lg` and the variant `?variant=outline` - use what fits best to you!--Supported themes:-- `light` (default)-- `dark`--Supported sizes:-- `sm` (default)-- `md`-- `lg`-- `xl`--Supported variants:-- `default` (default)-- `outline`--The **outline** variant simply adds a slightly rounded border to the svg `rect`. It mainly can be used for GitHub README or Markdown where styling is not supported.--Compared to the PNG badge, we let you define the `border` and `border-radius` of the SVG badge and the font is mono.--It will display the following labels based on the current status of the status page:--```-All Systems Operational-Degraded Performance-Partial Outage-Major Outage-Ongoing Incident-Under Maintenance-Unknown-```-------Read more on which status is being shown [here](/tools/status-widget/#how-does-it-work).\ No newline at end of filediff --git a/apps/docs/src/content/docs/tools/status-widget.mdx b/apps/docs/src/content/docs/tools/status-widget.mdxdeleted file mode 100644index 8fe8928ea..000000000--- a/apps/docs/src/content/docs/tools/status-widget.mdx+++ /dev/null@@ -1,290 +0,0 @@-----title: Public Status Widget-description: "How to add a public status widget to your website."------import { Aside } from '@astrojs/starlight/components';-import { Image } from 'astro:assets';--import StatusWidget from '../../../assets/status-widget/widget-example.png';--We have added a public endpoint where you can access the status of your status-page. To access it, you only need the unique `:slug` you have chosen for your-page.--```bash-curl https://api.openstatus.dev/public/status/:slug-```--<Aside>- We have released an `@openstatus/react` npm package that allows you to easily- integrate the pre-typed status into your React projects or use the default- widget. Read more [here](/tools/react).-</Aside>--The response is a JSON object with the following structure:--```json-{ "status": "operational" }-```--in which the status can be one of the following values:--```ts-enum Status {- Operational = "operational",- DegradedPerformance = "degraded_performance",- PartialOutage = "partial_outage",- MajorOutage = "major_outage",- UnderMaintenance = "under_maintenance", // currently not in use- Unknown = "unknown",- Incident = "incident",-}-```--### How does it work?--The status is calculated by the ratio `uptime / (uptime + downtime)` of the last-5 cron jobs of each monitor which we accumulate together. It is a simple-calculation that gives us a good overview of the status of your services.--```ts-function getStatus(ratio: number) {- if (isNaN(ratio)) return Status.Unknown;- if (ratio >= 0.98) return Status.Operational;- if (ratio >= 0.6) return Status.DegradedPerformance;- if (ratio >= 0.3) return Status.PartialOutage;- if (ratio >= 0) return Status.MajorOutage;- return Status.Unknown;-}-```--We are caching the result for `30 seconds` to reduce the load on our database.--The `Status.Incident` will always be returned when then status of any incident-on your page is **not** _"monitoring"_ or _"resolved"_. You can attach an-incident to a monitor (implicit) or a page (explicit).--> If you have a doubt about the above calculation, feel free to contact us via-> [[email protected]](mailto:[email protected]) or-> [discord](https://openstatus.dev/discord).--### React Widget--We currently do not provide any SDK or package to integrate the status into your-stack. But will in the future.--If you are using Nextjs and RSC with the `/app` directory, feel free to use that-Component. Small reminder that we are using shadcn ui and tailwindcss. You might-want to update the `bg-muted` and `text-foreground` classes to your needs.--<br />--<Image src={StatusWidget} alt="Status Widget" />---<br />--We are using `zod` to validate the response. You can use any other library if-you want or just remove it. But better be safe than sorry.--```tsx-import * as z from "zod";--const statusEnum = z.enum([- "operational",- "degraded_performance",- "partial_outage",- "major_outage",- "under_maintenance",- "unknown",- "incident",-]);--const statusSchema = z.object({ status: statusEnum });--const dictionary = {- operational: {- label: "Operational",- color: "bg-green-500",- },- degraded_performance: {- label: "Degraded Performance",- color: "bg-yellow-500",- },- partial_outage: {- label: "Partial Outage",- color: "bg-yellow-500",- },- major_outage: {- label: "Major Outage",- color: "bg-red-500",- },- unknown: {- label: "Unknown",- color: "bg-gray-500",- },- incident: {- label: "Incident",- color: "bg-yellow-500",- },- under_maintenance: {- label: "Under Maintenance",- color: "bg-blue-500",- },-} as const;--export async function StatusWidget({ slug }: { slug: string }) {- const res = await fetch(`https://api.openstatus.dev/public/status/${slug}`, {- next: { revalidate: 60 }, // cache request for 60 seconds- });- const data = await res.json();- const parsed = statusSchema.safeParse(data);-- if (!parsed.success) {- return null;- }-- const key = parsed.data.status;- const { label, color } = dictionary[key];-- return (- <a- className="border-border text-foreground/70 hover:bg-muted hover:text-foreground inline-flex max-w-fit items-center gap-2 rounded-md border px-3 py-1 text-sm"- href={`https://${slug}.openstatus.dev`}- target="_blank"- rel="noreferrer"- >- {label}- <span className="relative flex h-2 w-2">- {parsed.data.status === "operational" ? (- <span- className={`absolute inline-flex h-full w-full animate-ping rounded-full ${color} opacity-75 duration-1000`}- />- ) : null}- <span- className={`relative inline-flex h-2 w-2 rounded-full ${color}`}- />- </span>- </a>- );-}-```--Then, import your `StatusWidget.tsx` component to your layout as well as the slug prop to your specific monitor. Ideally, relative imports would be setup in your `tsconfig.json`.-```jsx-import StatusWidget from '../../components/StatusWidget.tsx---<StatusWidget slug="monitor-slug-here" />-```--### Astro Widget-```astro-----import * as z from "zod"--const statusEnum = z.enum([- "operational",- "degraded_performance",- "partial_outage",- "major_outage",- "under_maintenance",- "unknown",- "incident",-])--const statusSchema = z.object({ status: statusEnum })--const dictionary = {- operational: {- label: "Operational",- color: "bg-green-500",- },- degraded_performance: {- label: "Degraded Performance",- color: "bg-yellow-500",- },- partial_outage: {- label: "Partial Outage",- color: "bg-yellow-500",- },- major_outage: {- label: "Major Outage",- color: "bg-red-500",- },- unknown: {- label: "Unknown",- color: "bg-gray-500",- },- incident: {- label: "Incident",- color: "bg-yellow-500",- },- under_maintenance: {- label: "Under Maintenance",- color: "bg-blue-500",- },-}--const slug = Astro.props.slug--const res = await fetch(`https://api.openstatus.dev/public/status/${slug}`, {- // @ts-ignore- next: { revalidate: 60 },-})-const data = await res.json()-const parsed = statusSchema.safeParse(data)-if (!parsed.success) {- return null-}-const key = parsed.data.status-const { label, color } = dictionary[key]------<a- class="border-border text-foreground/70 hover:bg-muted hover:text-foreground inline-flex max-w-fit items-center gap-2 rounded-md border px-3 py-1 text-sm"- href={`https://${slug}.openstatus.dev`}- target="_blank"- rel="noreferrer"->- {label}- <span class="relative flex h-2 w-2">- {- parsed.data.status === "operational" ? (- <span- class:list={[- "absolute",- "inline-flex",- "h-full",- "w-full",- "animate-ping",- "rounded-full",- color,- "opacity-75",- "duration-1000",- ]}- />- ) : null- }- <span- class:list={[- "relative",- "inline-flex",- "h-2",- "w-2",- "rounded-full",- color,- ]}></span>- </span>-</a>-```--Then, import your `StatusWidget.astro` component as well as the slug from your specific monitor to your layout, most likely your footer. It would be better to have relative imports setup in your tsconfig.json.-```astro-----import StatusWidget from '../../components/StatusWidget.astro'------<StatusWidget slug="monitor-slug-here" />-```\ No newline at end of filediff --git a/apps/docs/src/content/docs/tools/terraform.mdx b/apps/docs/src/content/docs/tools/terraform.mdxdeleted file mode 100644index 45b86ec76..000000000--- a/apps/docs/src/content/docs/tools/terraform.mdx+++ /dev/null@@ -1,27 +0,0 @@-----title: Terraform Provider-description:- "Use openstatus Terraform provider to manage your monitors and status page."------Here you can find the official openstatus Terraform provider. This provider-allows you to manage your monitors and status page using Terraform.--https://registry.terraform.io/providers/openstatusHQ/openstatus/latest--## Usage--```-provider "openstatus" {- openstatus_api_token= "YOUR_API_TOKEN"-}--resource "openstatus_monitor" "my_monitor" {- url = "https://www.openstatus.dev"- regions= ["iad", "jnb"]- periodicity = "10m"- name = "test-monitor"- active = true- description = "This is a test monitor"-}-```diff --git a/apps/docs/src/content/docs/tutorial/get-started-with-openstatus-cli.mdx b/apps/docs/src/content/docs/tutorial/get-started-with-openstatus-cli.mdxindex 802acf08d..bba6c07b9 100644--- a/apps/docs/src/content/docs/tutorial/get-started-with-openstatus-cli.mdx+++ b/apps/docs/src/content/docs/tutorial/get-started-with-openstatus-cli.mdx@@ -166,7 +166,6 @@ export PATH="$HOME/.local/bin:$PATH"Now that you have the CLI set up, you can:- **[Monitor Your MCP Server](/guides/how-to-monitor-mcp-server/)** - Example of CLI-based monitor configuration-- **[Monitoring as Code](/monitoring/monitoring-as-code)** - Learn about the YAML configuration format- **[CLI Reference](/reference/cli-reference)** - Complete command documentation- **[Set up CI/CD](/guides/how-to-run-synthetic-test-github-action/)** - Automate monitoring in your pipelinediff --git a/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx b/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdxindex ce6715774..882390d6a 100644--- a/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx+++ b/apps/docs/src/content/docs/tutorial/how-to-configure-status-page.mdx@@ -138,7 +138,6 @@ Excellent work! You've successfully:Now that your status page is configured, you can:-- **[Configure Notifications](/monitoring/customization/notification)** - Alert your team when issues occur- **[Building Trust with Status Pages](/concept/best-practices-status-page)** - Learn effective incident communication- **[Add Status Subscribers](/reference/subscriber)** - Let users subscribe to updatesdiff --git a/apps/docs/src/content/docs/tutorial/how-to-create-monitor.mdx b/apps/docs/src/content/docs/tutorial/how-to-create-monitor.mdxindex 8bb1182ec..4ca5500ca 100644--- a/apps/docs/src/content/docs/tutorial/how-to-create-monitor.mdx+++ b/apps/docs/src/content/docs/tutorial/how-to-create-monitor.mdx@@ -121,14 +121,11 @@ Congratulations! You've successfully:Now that you have a monitor running, you can:- **[Create a Status Page](/tutorial/how-to-create-status-page)** - Share your service status publicly with users-- **[Set Up Alerting](/monitoring/customization/notification)** - Get notified when your service goes down-- **[Configure Assertions](/monitoring/customization/assertions)** - Validate response content, not just status codes-- **[Add Multiple Regions](/monitoring/customization/locations)** - Monitor from different global locations+### Learn more- **[Understanding Uptime Monitoring](/concept/uptime-monitoring)** - Deep dive into monitoring concepts-- **[Monitor Data Collected](/monitoring/monitor-data-collected)** - What metrics we track- **[HTTP Monitor Reference](/reference/http-monitor)** - Complete technical specificationsdiff --git a/apps/docs/src/content/docs/tutorial/how-to-create-private-location.mdx b/apps/docs/src/content/docs/tutorial/how-to-create-private-location.mdxindex 3d7d425e9..ee4481a97 100644--- a/apps/docs/src/content/docs/tutorial/how-to-create-private-location.mdx+++ b/apps/docs/src/content/docs/tutorial/how-to-create-private-location.mdx@@ -133,4 +133,3 @@ docker run -d \- **[Read our Raspberry Pi deployment guide](https://www.openstatus.dev/blog/deploy-private-locations-raspberry-pi)** โ Deploy probes on low-cost hardware- **[Create a Monitor](/tutorial/how-to-create-monitor)** โ Set up more monitors to run from your private location-- **[Configure Notifications](/monitoring/customization/notification)** โ Get alerted when services go down (via public regions)diff --git a/apps/docs/src/content/docs/tutorial/how-to-create-status-page.mdx b/apps/docs/src/content/docs/tutorial/how-to-create-status-page.mdxindex fd3502747..c428bb6c8 100644--- a/apps/docs/src/content/docs/tutorial/how-to-create-status-page.mdx+++ b/apps/docs/src/content/docs/tutorial/how-to-create-status-page.mdx@@ -88,7 +88,6 @@ Great work! You've successfully:Now that you have a basic status page, you can:- **[Configure Your Status Page](/tutorial/how-to-configure-status-page)** - Customize appearance and add more features-- **[Configure Notifications](/monitoring/customization/notification)** - Alert your team when issues occur- **[Building Trust with Status Pages](/concept/best-practices-status-page)** - Learn how to communicate effectively### Learn morediff --git a/apps/web/src/app/api/internal/email/feedback/route.ts b/apps/web/src/app/api/internal/email/feedback/route.tsnew file mode 100644index 000000000..9455414f8--- /dev/null+++ b/apps/web/src/app/api/internal/email/feedback/route.ts@@ -0,0 +1,39 @@+import type { NextRequest } from "next/server";++import { and, gte, lte } from "@openstatus/db";+import { db } from "@openstatus/db/src/db";+import { user } from "@openstatus/db/src/schema";+import { FeedbackEmail, sendEmail } from "@openstatus/emails";++export async function GET(request: NextRequest) {+ const authHeader = request.headers.get("authorization");+ if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {+ return new Response("Unauthorized", { status: 401 });+ }++ const date1 = new Date();+ date1.setDate(date1.getDate() - 15);+ const date2 = new Date();+ date2.setDate(date2.getDate() - 14);++ const users = await db+ .select({ email: user.email })+ .from(user)+ .where(and(gte(user.createdAt, date1), lte(user.createdAt, date2)))+ .all();++ let sent = 0;+ for (const u of users) {+ if (!u.email || u.email.trim() === "") continue;++ await sendEmail({+ from: "Thibault from OpenStatus <[email protected]>",+ subject: "One quick question",+ to: [u.email],+ react: FeedbackEmail(),+ });+ sent++;+ }++ return Response.json({ success: true, sent });+}diff --git a/apps/web/src/app/api/internal/email/route.ts b/apps/web/src/app/api/internal/email/route.tsindex 59abc10b4..615d79ef0 100644--- a/apps/web/src/app/api/internal/email/route.ts+++ b/apps/web/src/app/api/internal/email/route.ts@@ -1,9 +1,17 @@import type { NextRequest } from "next/server";-import { and, gte, lte } from "@openstatus/db";+import { and, eq, gte, inArray, lte } from "@openstatus/db";import { db } from "@openstatus/db/src/db";-import { user } from "@openstatus/db/src/schema";-import { FollowUpEmail, sendEmail } from "@openstatus/emails";+import {+ integration,+ user,+ usersToWorkspaces,+} from "@openstatus/db/src/schema";+import {+ FollowUpEmail,+ SlackFeedbackEmail,+ sendEmail,+} from "@openstatus/emails";export async function GET(request: NextRequest) {const authHeader = request.headers.get("authorization");@@ -15,23 +23,57 @@ export async function GET(request: NextRequest) {}const date1 = new Date();- date1.setDate(date1.getDate() - 3);+ date1.setDate(date1.getDate() - 2);const date2 = new Date();- date2.setDate(date2.getDate() - 2);+ date2.setDate(date2.getDate() - 1);+const users = await db- .select()+ .select({+ email: user.email,+ workspaceId: usersToWorkspaces.workspaceId,+ }).from(user)+ .innerJoin(usersToWorkspaces, eq(user.id, usersToWorkspaces.userId)).where(and(gte(user.createdAt, date1), lte(user.createdAt, date2))).all();- for (const user of users) {- if (user.email) {- await sendEmail({- from: "Thibault from OpenStatus <[email protected]>",- subject: "How's it going with OpenStatus?",- to: [user.email],- react: FollowUpEmail(),- });++ const workspaceIds = [+ ...new Set(users.map((u) => u.workspaceId).filter(Boolean)),+ ];++ const slackWorkspaceIds = new Set<number>();+ if (workspaceIds.length > 0) {+ const slackIntegrations = await db+ .select({ workspaceId: integration.workspaceId })+ .from(integration)+ .where(+ and(+ eq(integration.name, "slack-agent"),+ inArray(integration.workspaceId, workspaceIds),+ ),+ )+ .all();+ for (const row of slackIntegrations) {+ if (row.workspaceId) {+ slackWorkspaceIds.add(row.workspaceId);+ }}}++ for (const u of users) {+ if (!u.email) continue;+ const hasSlack = u.workspaceId+ ? slackWorkspaceIds.has(u.workspaceId)+ : false;++ await sendEmail({+ from: "Thibault from OpenStatus <[email protected]>",+ subject: hasSlack+ ? "How's the Slack app working for you?"+ : "Manage incidents from Slack",+ to: [u.email],+ react: hasSlack ? SlackFeedbackEmail() : FollowUpEmail(),+ });+ }return Response.json({ success: true });}diff --git a/apps/web/src/app/api/internal/email/team-invite/route.ts b/apps/web/src/app/api/internal/email/team-invite/route.tsnew file mode 100644index 000000000..0c216ee59--- /dev/null+++ b/apps/web/src/app/api/internal/email/team-invite/route.ts@@ -0,0 +1,80 @@+import type { NextRequest } from "next/server";++import { and, count, eq, gte, inArray, lte } from "@openstatus/db";+import { db } from "@openstatus/db/src/db";+import { invitation, user, usersToWorkspaces } from "@openstatus/db/src/schema";+import { TeamInviteReminderEmail, sendEmail } from "@openstatus/emails";++export async function GET(request: NextRequest) {+ const authHeader = request.headers.get("authorization");+ if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {+ return new Response("Unauthorized", { status: 401 });+ }++ const date1 = new Date();+ date1.setDate(date1.getDate() - 6);+ const date2 = new Date();+ date2.setDate(date2.getDate() - 5);++ const users = await db+ .select({+ email: user.email,+ workspaceId: usersToWorkspaces.workspaceId,+ })+ .from(user)+ .innerJoin(usersToWorkspaces, eq(user.id, usersToWorkspaces.userId))+ .where(and(gte(user.createdAt, date1), lte(user.createdAt, date2)))+ .all();++ const workspaceIds = [+ ...new Set(users.map((u) => u.workspaceId).filter(Boolean)),+ ];++ if (workspaceIds.length === 0) {+ return Response.json({ success: true, sent: 0 });+ }++ const workspaceMemberCounts = await db+ .select({+ workspaceId: usersToWorkspaces.workspaceId,+ memberCount: count(usersToWorkspaces.userId),+ })+ .from(usersToWorkspaces)+ .where(inArray(usersToWorkspaces.workspaceId, workspaceIds))+ .groupBy(usersToWorkspaces.workspaceId)+ .all();++ const workspacesWithInvitations = await db+ .select({ workspaceId: invitation.workspaceId })+ .from(invitation)+ .where(inArray(invitation.workspaceId, workspaceIds))+ .groupBy(invitation.workspaceId)+ .all();++ const hasTeamActivity = new Set<number>();++ for (const row of workspaceMemberCounts) {+ if (row.memberCount > 1) {+ hasTeamActivity.add(row.workspaceId);+ }+ }+ for (const row of workspacesWithInvitations) {+ hasTeamActivity.add(row.workspaceId);+ }++ let sent = 0;+ for (const u of users) {+ if (!u.email) continue;+ if (u.workspaceId && hasTeamActivity.has(u.workspaceId)) continue;++ await sendEmail({+ from: "Thibault from OpenStatus <[email protected]>",+ subject: "Incidents are a team sport",+ to: [u.email],+ react: TeamInviteReminderEmail(),+ });+ sent++;+ }++ return Response.json({ success: true, sent });+}diff --git a/apps/web/vercel.json b/apps/web/vercel.jsonindex e317722fd..e398cca52 100644--- a/apps/web/vercel.json+++ b/apps/web/vercel.json@@ -2,7 +2,15 @@"crons": [{"path": "/api/internal/email",- "schedule": "00 17 * * *"+ "schedule": "13 17 * * *"+ },+ {+ "path": "/api/internal/email/team-invite",+ "schedule": "12 14 * * *"+ },+ {+ "path": "/api/internal/email/feedback",+ "schedule": "30 15 * * *"}]}diff --git a/apps/workflows/src/cron/emails.ts b/apps/workflows/src/cron/emails.tsindex 1b56156d5..e35abce1b 100644--- a/apps/workflows/src/cron/emails.ts+++ b/apps/workflows/src/cron/emails.ts@@ -1,45 +1,90 @@-import { and, gte, lte } from "@openstatus/db";+import { and, eq, gte, inArray, lte } from "@openstatus/db";import { db } from "@openstatus/db";-import { user } from "@openstatus/db/src/schema";+import {+ integration,+ user,+ usersToWorkspaces,+} from "@openstatus/db/src/schema";import { EmailClient } from "@openstatus/emails";import { env } from "../env";-// import { db } from "../lib/db";const email = new EmailClient({ apiKey: env().RESEND_API_KEY });export async function sendFollowUpEmails() {- // Get users created 2-3 days agoconst date1 = new Date();- date1.setDate(date1.getDate() - 3);+ date1.setDate(date1.getDate() - 2);const date2 = new Date();- date2.setDate(date2.getDate() - 2);+ date2.setDate(date2.getDate() - 1);const users = await db.select({email: user.email,+ workspaceId: usersToWorkspaces.workspaceId,}).from(user)+ .innerJoin(usersToWorkspaces, eq(user.id, usersToWorkspaces.userId)).where(and(gte(user.createdAt, date1), lte(user.createdAt, date2))).all();console.log(`Found ${users.length} users to send follow ups.`);- // Filter valid emails- const validEmails = users- .map((u) => u.email)- .filter((email) => email !== null)- // I don't know why but I can't have both filter at the same time- .filter((email) => email.trim() !== "");+ const workspaceIds = [+ ...new Set(users.map((u) => u.workspaceId).filter(Boolean)),+ ];++ const slackWorkspaceIds = new Set<number>();+ if (workspaceIds.length > 0) {+ const slackIntegrations = await db+ .select({ workspaceId: integration.workspaceId })+ .from(integration)+ .where(+ and(+ eq(integration.name, "slack-agent"),+ inArray(integration.workspaceId, workspaceIds),+ ),+ )+ .all();+ for (const row of slackIntegrations) {+ if (row.workspaceId) {+ slackWorkspaceIds.add(row.workspaceId);+ }+ }+ }++ const slackEmails: string[] = [];+ const noSlackEmails: string[] = [];++ for (const u of users) {+ if (!u.email || u.email.trim() === "") continue;+ const hasSlack = u.workspaceId+ ? slackWorkspaceIds.has(u.workspaceId)+ : false;+ if (hasSlack) {+ slackEmails.push(u.email);+ } else {+ noSlackEmails.push(u.email);+ }+ }- // Chunk emails into batches of 80const batchSize = 80;- for (let i = 0; i < validEmails.length; i += batchSize) {- const batch = validEmails.slice(i, i + batchSize);- console.log(`Sending batch with ${batch.length} emails...`);++ for (let i = 0; i < noSlackEmails.length; i += batchSize) {+ const batch = noSlackEmails.slice(i, i + batchSize);+ console.log(`Sending follow-up batch with ${batch.length} emails...`);try {await email.sendFollowUpBatched({ to: batch });} catch {- //Stop email send when rate limit error is faced in order to avoid wasteful API calls+ console.error("Rate limit exceeded. Stopping further sends.");+ break;+ }+ }++ for (let i = 0; i < slackEmails.length; i += batchSize) {+ const batch = slackEmails.slice(i, i + batchSize);+ console.log(`Sending slack feedback batch with ${batch.length} emails...`);+ try {+ await email.sendSlackFeedbackBatched({ to: batch });+ } catch {console.error("Rate limit exceeded. Stopping further sends.");break;}diff --git a/packages/emails/emails/feedback.tsx b/packages/emails/emails/feedback.tsxnew file mode 100644index 000000000..27800b7ae--- /dev/null+++ b/packages/emails/emails/feedback.tsx@@ -0,0 +1,33 @@+/** @jsxImportSource react */++import { Body, Head, Html, Preview } from "@react-email/components";++const FeedbackEmail = () => {+ return (+ <Html>+ <Head>+ <title>One quick question</title>+ </Head>+ <Preview>What's the one thing you'd change about OpenStatus?</Preview>+ <Body>+ Hey+ <br />+ <br />+ You've been on OpenStatus for about two weeks now. One quick question:+ <br />+ <br />+ What's the one thing you wish OpenStatus did differently?+ <br />+ <br />+ No survey, no form โ just hit reply. I read every response and it+ genuinely shapes what we build next.+ <br />+ <br />+ Thibault Le Ouay Ducasse, co-founder of OpenStatus+ <br />+ </Body>+ </Html>+ );+};++export default FeedbackEmail;diff --git a/packages/emails/emails/followup.tsx b/packages/emails/emails/followup.tsxindex 5d828a311..5a2ac01bc 100644--- a/packages/emails/emails/followup.tsx+++ b/packages/emails/emails/followup.tsx@@ -6,21 +6,31 @@ const FollowUpEmail = () => {return (<Html><Head>- <title>How's it going with openstatus?</title>+ <title>Manage incidents from Slack</title></Head>- <Preview>How's it going with openstatus?</Preview>+ <Preview>Update your status page without leaving Slack</Preview><Body>Hey<br /><br />- Howโs everything going with openstatus so far? Let me know if you run- into any issues, or have any feedback, good or bad!+ Quick tip: connect the OpenStatus Slack app and manage incident updates+ for your status page directly from Slack โ no need to switch tabs during+ an outage.<br />+ <br />๐{" "}+ <a href="https://app.openstatus.dev/agents?ref=email-followup">+ Install the Slack app+ </a><br />- Thank you,<br />+ When something goes wrong, just mention @openstatus to create or update+ an incident.<br />- Thibault Le Ouay Ducasse+ <br />+ Hit reply if you have questions โ happy to help.+ <br />+ <br />+ Thibault Le Ouay Ducasse, co-founder of OpenStatus<br /></Body></Html>diff --git a/packages/emails/emails/slack-feedback.tsx b/packages/emails/emails/slack-feedback.tsxnew file mode 100644index 000000000..f974629a8--- /dev/null+++ b/packages/emails/emails/slack-feedback.tsx@@ -0,0 +1,36 @@+/** @jsxImportSource react */++import { Body, Head, Html, Preview } from "@react-email/components";++const SlackFeedbackEmail = () => {+ return (+ <Html>+ <Head>+ <title>How's the Slack app working for you?</title>+ </Head>+ <Preview>We'd love your feedback on the OpenStatus Slack app</Preview>+ <Body>+ Hey+ <br />+ <br />I saw you installed the OpenStatus Slack app โ thanks for trying+ it out!+ <br />+ <br />+ Quick question: how's the incident management from Slack going so far?+ <br />+ <br />+ Anything missing or confusing? I'd love to hear what's working and what+ we could improve.+ <br />+ <br />+ Just hit reply โ I read every response.+ <br />+ <br />+ Thibault Le Ouay Ducasse, co-founder of OpenStatus+ <br />+ </Body>+ </Html>+ );+};++export default SlackFeedbackEmail;diff --git a/packages/emails/emails/team-invite-reminder.tsx b/packages/emails/emails/team-invite-reminder.tsxnew file mode 100644index 000000000..d2b5ac49c--- /dev/null+++ b/packages/emails/emails/team-invite-reminder.tsx@@ -0,0 +1,39 @@+/** @jsxImportSource react */++import { Body, Head, Html, Preview } from "@react-email/components";++const TeamInviteReminderEmail = () => {+ return (+ <Html>+ <Head>+ <title>Incidents are a team sport</title>+ </Head>+ <Preview>Invite your team so everyone can manage status updates</Preview>+ <Body>+ Hey+ <br />+ <br />+ When something goes down at 2am, you don't want to be the only one who+ can update the status page.+ <br />+ <br />๐{" "}+ <a href="https://app.openstatus.dev/settings/general?ref=email-team-invite">+ Invite your team+ </a>+ <br />+ <br />+ Everyone gets access to monitors, incidents, and status pages โ so+ whoever is on-call can respond without waiting on you.+ <br />+ <br />+ Hit reply if you have questions โ happy to help.+ <br />+ <br />+ Thibault Le Ouay Ducasse, co-founder of OpenStatus+ <br />+ </Body>+ </Html>+ );+};++export default TeamInviteReminderEmail;diff --git a/packages/emails/emails/welcome.tsx b/packages/emails/emails/welcome.tsxindex 7df7db4ad..362b2253b 100644--- a/packages/emails/emails/welcome.tsx+++ b/packages/emails/emails/welcome.tsx@@ -6,50 +6,38 @@ const WelcomeEmail = () => {return (<Html><Head>- <title>Welcome to openstatus</title>+ <title>Welcome to OpenStatus</title></Head>- <Preview>Few tips to get started with your uptime monitoring</Preview>+ <Preview>Set up your status page in under 5 minutes</Preview><Body>Hey ๐<br /><br />- Welcome to openstatus <br />+ Thanks for signing up for OpenStatus.<br /><br />- Openstatus is global uptime monitoring service with status page.+ The fastest way to get started: create your status page. It takes under+ 5 minutes and your users will have a single place to check if your+ services are up.<br />- Here are a few things you can do with openstatus:- <br />- Use our{" "}- <a href="https://docs.openstatus.dev/cli/getting-started/?ref=email-onboarding">- CLI- </a>{" "}- to create, update and trigger your monitors.- <br />- Learn how to monitor a{" "}- <a href="https://docs.openstatus.dev/guides/how-to-monitor-mcp-server?ref=email-onboarding">- MCP server- </a>- .- <br />- Explore our uptime monitoring as code{" "}- <a href="https://github.com/openstatusHQ/cli-template/?ref=email-onboarding">- template directory+ <br />๐{" "}+ <a href="https://app.openstatus.dev/status-pages/create?ref=email-onboarding">+ Create your status page</a>- .- <br />- Build your own status page with our{" "}- <a href="https://api.openstatus.dev/v1">API</a> and host it where you- want. Here's our{" "}- <a href="https://github.com/openstatusHQ/astro-status-page">- Astro template- </a>{" "}- that you can easily host on CloudFlare.<br /><br />- Quick question: How did you learn about us? and why did you sign up?+ Want full control? Use our{" "}+ <a href="https://www.openstatus.dev/registry?ref=email-onboarding">+ open source+ </a>{" "}+ to build your own status page and host it anywhere.+ <br /><br />- Thank you,+ Hit reply if you get stuck โ I read every response.<br /><br />- Thibault Le Ouay Ducasse, co-founder of openstatus+ Thibault Le Ouay Ducasse, co-founder of OpenStatus<br /></Body></Html>diff --git a/packages/emails/src/client.tsx b/packages/emails/src/client.tsxindex c2d2dea50..3dccc9b92 100644--- a/packages/emails/src/client.tsx+++ b/packages/emails/src/client.tsx@@ -7,6 +7,7 @@ import FollowUpEmail from "../emails/followup";import type { MonitorAlertProps } from "../emails/monitor-alert";import PageSubscriptionEmail from "../emails/page-subscription";import type { PageSubscriptionProps } from "../emails/page-subscription";+import SlackFeedbackEmail from "../emails/slack-feedback";import StatusPageMagicLinkEmail from "../emails/status-page-magic-link";import type { StatusPageMagicLinkProps } from "../emails/status-page-magic-link";import StatusReportEmail from "../emails/status-report";@@ -89,6 +90,62 @@ export class EmailClient {console.log(`Sent follow up emails to ${req.to}`);}+ public async sendSlackFeedback(req: { to: string }) {+ if (process.env.NODE_ENV === "development") {+ console.log(`Sending slack feedback email to ${req.to}`);+ return;+ }++ try {+ const html = await render(<SlackFeedbackEmail />);+ const result = await this.client.emails.send({+ from: "Thibault Le Ouay Ducasse <[email protected]>",+ replyTo: "Thibault Le Ouay Ducasse <[email protected]>",+ subject: "How's the Slack app working for you?",+ to: req.to,+ html,+ });++ if (!result.error) {+ console.log(`Sent slack feedback email to ${req.to}`);+ return;+ }++ throw result.error;+ } catch (err) {+ console.error(`Error sending slack feedback email to ${req.to}: ${err}`);+ }+ }++ public async sendSlackFeedbackBatched(req: { to: string[] }) {+ if (process.env.NODE_ENV === "development") {+ console.log(`Sending slack feedback emails to ${req.to.join(", ")}`);+ return;+ }++ const html = await render(<SlackFeedbackEmail />);+ const result = await this.client.batch.send(+ req.to.map((subscriber) => ({+ from: "Thibault Le Ouay Ducasse <[email protected]>",+ subject: "How's the Slack app working for you?",+ to: subscriber,+ html,+ })),+ );++ if (result.error) {+ if (result.error?.name === "rate_limit_exceeded") {+ throw result.error;+ }+ console.error(+ `Error sending slack feedback email to ${req.to}: ${result.error}`,+ );+ return;+ }++ console.log(`Sent slack feedback emails to ${req.to}`);+ }+public async sendStatusReportUpdate(req: Omit<StatusReportProps, "unsubscribeUrl" | "manageUrl"> & {subscribers: Array<{ email: string; token: string }>;diff --git a/packages/emails/src/index.ts b/packages/emails/src/index.tsindex bb21ddfa4..d8c9f0ddd 100644--- a/packages/emails/src/index.ts+++ b/packages/emails/src/index.ts@@ -1,5 +1,8 @@+export { default as FeedbackEmail } from "../emails/feedback";export { default as FollowUpEmail } from "../emails/followup";+export { default as SlackFeedbackEmail } from "../emails/slack-feedback";export { default as SubscribeEmail } from "../emails/subscribe";+export { default as TeamInviteReminderEmail } from "../emails/team-invite-reminder";export { default as WelcomeEmail } from "../emails/welcome";export { default as TeamInvitationEmail } from "../emails/team-invitation";export { default as MonitorPausedEmail } from "../emails/monitor-paused";