|
| 1 | +# UptimeRobot Status Page Integration |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The UptimeRobot integration automatically displays service status banners at the top of your cBioPortal instance when incidents, maintenance, or other events are detected from your UptimeRobot status page. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- **Automatic Event Detection**: Fetches active events from UptimeRobot's event feed API |
| 10 | +- **Smart Filtering**: Only displays ongoing events (status = 2) within their time window |
| 11 | +- **Severity-Based Styling**: Banner colors adapt based on event severity |
| 12 | +- **Status Page Link**: Each banner includes a link to the full status page |
| 13 | +- **User Control**: Users can dismiss banners (dismissed state stored in browser localStorage) |
| 14 | +- **Priority Display**: Status events appear before static portal messages |
| 15 | + |
| 16 | +## Configuration |
| 17 | + |
| 18 | +### Requirements |
| 19 | + |
| 20 | +Both configuration properties must be set to enable the integration: |
| 21 | + |
| 22 | +```properties |
| 23 | +uptime_robot_status_page_url=https://status.cbioportal.org |
| 24 | +uptime_robot_api_key=YOUR_API_KEY_HERE |
| 25 | +``` |
| 26 | + |
| 27 | +Add these to your `application.properties` file. |
| 28 | + |
| 29 | +### Getting Your UptimeRobot API Key |
| 30 | + |
| 31 | +1. Log in to your [UptimeRobot account](https://uptimerobot.com/) |
| 32 | +2. Navigate to "Status Pages" |
| 33 | +3. Open your status page settings |
| 34 | +4. Look for the "Event Feed" or "API" section |
| 35 | +5. Copy the API key (e.g., `RlrzpsmAn`) |
| 36 | +6. Note your status page URL (e.g., `https://status.cbioportal.org`) |
| 37 | + |
| 38 | +### Testing the Configuration |
| 39 | + |
| 40 | +You can test your API endpoint manually: |
| 41 | + |
| 42 | +```bash |
| 43 | +curl https://status.cbioportal.org/api/getEventFeed/YOUR_API_KEY |
| 44 | +``` |
| 45 | + |
| 46 | +You should receive a JSON response containing event data. |
| 47 | + |
| 48 | +## How It Works |
| 49 | + |
| 50 | +### Event Fetching |
| 51 | + |
| 52 | +When a user loads the portal, the frontend automatically fetches events from: |
| 53 | + |
| 54 | +``` |
| 55 | +{status_page_url}/api/getEventFeed/{api_key} |
| 56 | +``` |
| 57 | + |
| 58 | +### Event Filtering |
| 59 | + |
| 60 | +Only events matching ALL of the following criteria are displayed: |
| 61 | + |
| 62 | +1. **Active Status**: `event.status === 2` (ongoing event) |
| 63 | +2. **Started**: Current time >= event start time |
| 64 | +3. **Not Ended**: Current time < event end time (if specified) |
| 65 | + |
| 66 | +### Banner Display |
| 67 | + |
| 68 | +Banners appear at the very top of the page with: |
| 69 | +- **Event title** in bold |
| 70 | +- **Event description** (if available) |
| 71 | +- **"View status page"** link to the full status page |
| 72 | +- **Close button** (×) to dismiss |
| 73 | + |
| 74 | +### Banner Colors |
| 75 | + |
| 76 | +Banner background colors are determined by the event's severity icon: |
| 77 | + |
| 78 | +| Icon Type | Color | Use Case | |
| 79 | +|-----------|-------|----------| |
| 80 | +| `alert-triangle`, `alert-octagon` | Red (#d9534f) | Critical incidents, outages | |
| 81 | +| `alert-circle` | Orange (#f0ad4e) | Warnings, degraded performance | |
| 82 | +| `info` | Blue (#5bc0de) | Informational notices | |
| 83 | +| `check-circle` | Green (#5cb85c) | Resolved issues, all clear | |
| 84 | +| (default) | Orange (#f0ad4e) | Unspecified severity | |
| 85 | + |
| 86 | +## Example Event |
| 87 | + |
| 88 | +An UptimeRobot event like this: |
| 89 | + |
| 90 | +```json |
| 91 | +{ |
| 92 | + "type": "announcement", |
| 93 | + "id": 34971, |
| 94 | + "title": "AWS Downtime", |
| 95 | + "description": "Various services are affected due to AWS downtime", |
| 96 | + "status": 2, |
| 97 | + "icon": "alert-triangle", |
| 98 | + "timestamp": 1760958000, |
| 99 | + "endDateGMT": "Oct 21, 2025 11:00" |
| 100 | +} |
| 101 | +``` |
| 102 | + |
| 103 | +Will be displayed as a red banner: |
| 104 | + |
| 105 | +``` |
| 106 | +┌─────────────────────────────────────────────────────────────┐ |
| 107 | +│ AWS Downtime: Various services are affected due to AWS │ |
| 108 | +│ downtime View status page [×] │ |
| 109 | +└─────────────────────────────────────────────────────────────┘ |
| 110 | +``` |
| 111 | + |
| 112 | +## User Experience |
| 113 | + |
| 114 | +### Banner Dismissal |
| 115 | + |
| 116 | +Users can dismiss banners by clicking the × button. Dismissal is tracked per-event using browser localStorage with the key format: |
| 117 | + |
| 118 | +``` |
| 119 | +portalMessageKey-uptime-robot-{event.id} |
| 120 | +``` |
| 121 | + |
| 122 | +Once dismissed, the banner won't reappear unless: |
| 123 | +- The user clears their browser localStorage |
| 124 | +- A new event with a different ID is created |
| 125 | + |
| 126 | +### Multiple Providers |
| 127 | + |
| 128 | +The integration uses a provider pattern that allows for easy addition of other status page services (e.g., StatusPage.io, Atlassian Status). Status provider messages take priority over static portal announcements. |
| 129 | + |
| 130 | +## Troubleshooting |
| 131 | + |
| 132 | +### Banners Not Appearing |
| 133 | + |
| 134 | +1. **Verify Configuration**: |
| 135 | + - Check both `uptime_robot_status_page_url` and `uptime_robot_api_key` are set |
| 136 | + - Ensure there are no trailing slashes in the URL |
| 137 | + - Confirm the API key is correct |
| 138 | + |
| 139 | +2. **Check Browser Console**: |
| 140 | + - Look for network errors fetching the event feed |
| 141 | + - Check for CORS issues (status page must allow your domain) |
| 142 | + - Verify JavaScript console for error messages |
| 143 | + |
| 144 | +3. **Verify Event Status**: |
| 145 | + - Events must have `status: 2` (active) |
| 146 | + - Event must be within its time window |
| 147 | + - Check if event was previously dismissed (clear localStorage to test) |
| 148 | + |
| 149 | +### CORS Issues |
| 150 | + |
| 151 | +If you see CORS (Cross-Origin Resource Sharing) errors in the browser console: |
| 152 | + |
| 153 | +- **Option 1**: Configure CORS headers on your UptimeRobot status page (if supported) |
| 154 | +- **Option 2**: Add a proxy endpoint in your cBioPortal backend to fetch events server-side |
| 155 | + |
| 156 | +### Debugging |
| 157 | + |
| 158 | +Enable browser console logging to see: |
| 159 | +- Network requests to the UptimeRobot API |
| 160 | +- Fetched event data |
| 161 | +- Filter results (which events are active) |
| 162 | +- Any error messages |
| 163 | + |
| 164 | +## Security Considerations |
| 165 | + |
| 166 | +- The API key is exposed to the frontend and included in browser requests |
| 167 | +- Use UptimeRobot's public status page API key (not your account API key) |
| 168 | +- The API key only allows reading public event data |
| 169 | +- No sensitive portal data is sent to UptimeRobot |
| 170 | + |
| 171 | +## Architecture |
| 172 | + |
| 173 | +The integration is implemented using a provider pattern for extensibility: |
| 174 | + |
| 175 | +``` |
| 176 | +Frontend (React): |
| 177 | + src/shared/lib/statusProviders/ |
| 178 | + ├── IStatusProvider.ts (interface) |
| 179 | + ├── UptimeRobotStatusProvider.tsx (implementation) |
| 180 | + ├── uptimeRobot.ts (API functions) |
| 181 | + └── index.ts (provider registry) |
| 182 | +``` |
| 183 | + |
| 184 | +This architecture makes it easy to add additional status page integrations without modifying core application code. |
| 185 | + |
| 186 | +## Disabling the Integration |
| 187 | + |
| 188 | +To disable the integration, simply remove or comment out both configuration properties: |
| 189 | + |
| 190 | +```properties |
| 191 | +# uptime_robot_status_page_url=https://status.cbioportal.org |
| 192 | +# uptime_robot_api_key=YOUR_API_KEY_HERE |
| 193 | +``` |
| 194 | + |
| 195 | +The integration will automatically disable if either property is missing. |
| 196 | + |
| 197 | +## Further Information |
| 198 | + |
| 199 | +- [UptimeRobot Documentation](https://uptimerobot.com/api/) |
| 200 | +- [UptimeRobot Status Pages](https://uptimerobot.com/statusPages) |
| 201 | +- [cBioPortal Customization Guide](./Customizing-your-instance-of-cBioPortal.md) |
0 commit comments