Code Monkey home page Code Monkey logo

cli's Introduction

Upptime

Upptime (https://upptime.js.org) is the open-source uptime monitor and status page, powered entirely by GitHub Actions, Issues, and Pages. It's made with ๐Ÿ’š by Anand Chowdhary, supported by Pabio.

I find Upptime an incredible clever usage of [GitHub Actions]. You essentially get a free configurable uptime monitor for whatever you want. โ€“ CSS Tricks

Upptime is used by 1,000+ people and teams to ensure they know when their endpoints go down.

Uptime CI Response Time CI Graphs CI Static Site CI Summary CI

๐Ÿ“ˆ Live Status: ๐ŸŸง Partial outage

URL Status History Response Time Uptime
Google ๐ŸŸฉ Up google.yml
Response time graph 187ms
Response time 108
24-hour response time 196
7-day response time 187
30-day response time 156
1-year response time 112
99.71%All-time uptime 100.00%
24-hour uptime 100.00%
7-day uptime 99.71%
30-day uptime 99.93%
1-year uptime 99.98%
Wikipedia ๐ŸŸฉ Up wikipedia.yml
Response time graph 332ms
Response time 241
24-hour response time 868
7-day response time 332
30-day response time 221
1-year response time 248
100.00%All-time uptime 100.00%
24-hour uptime 100.00%
7-day uptime 100.00%
30-day uptime 100.00%
1-year uptime 100.00%
Hacker News ๐ŸŸฉ Up hacker-news.yml
Response time graph 250ms
Response time 404
24-hour response time 336
7-day response time 250
30-day response time 257
1-year response time 434
100.00%All-time uptime 98.57%
24-hour uptime 100.00%
7-day uptime 100.00%
30-day uptime 100.00%
1-year uptime 99.94%
Test Broken Site ๐ŸŸฅ Down test-broken-site.yml
Response time graph 0ms
Response time 0
24-hour response time 0
7-day response time 0
30-day response time 0
1-year response time 0
0.00%All-time uptime 0.00%
24-hour uptime 0.00%
7-day uptime 0.00%
30-day uptime 1.38%
1-year uptime 0.00%
IPv6 test ๐ŸŸฅ Down i-pv6-test.yml
Response time graph 0ms
Response time 4
24-hour response time 0
7-day response time 0
30-day response time 0
1-year response time 4
0.00%All-time uptime 0.02%
24-hour uptime 0.00%
7-day uptime 0.00%
30-day uptime 1.38%
1-year uptime 0.02%

โญ How it works

  • GitHub Actions is used as an uptime monitor
    • Every 5 minutes, a workflow visits your website to make sure it's up
    • Response time is recorded every 6 hours and committed to git
    • Graphs of response time are generated every day
  • GitHub Issues is used for incident reports
    • An issue is opened if an endpoint is down
    • People from your team are assigned to the issue
    • Incidents reports are posted as issue comments
    • Issues are locked so non-members cannot comment on them
    • Issues are closed automatically when your site comes back up
    • Slack notifications are sent on updates
  • GitHub Pages is used for the status website
    • A simple, beautiful, and accessible PWA is generated
    • Built with Svelte and Sapper
    • Fetches data from this repository using the GitHub API

Upptime is not affiliated to or endorsed by GitHub.

Screenshot of status website

๐Ÿ‘ฉโ€๐Ÿ’ป Documentation

  1. How it works
  2. Getting started
  3. Configuration
  4. Triggers
  5. Notifications
  6. Badges
  7. Packages
  8. Contributing
  9. Frequently Asked Questions

Concepts

Issues as incidents

When the GitHub Actions workflow detects that one of your URLs is down, it automatically opens a GitHub issue (example issue #67). You can add incident reports to this issue by adding comments. When your site comes back up, the issue will be closed automatically as well.

Screenshot of GitHub issue Screenshot of incident page

Commits for response time

Four times per day, another workflow runs and records the response time of your websites. This data is committed to GitHub, so it's available in the commit history of each file (example commit history). Then, the GitHub API is used to graph the response time history of each endpoint and to track when a site went down.

Screenshot of GitHub commits Screenshot of live status

๐Ÿ“„ License

cli's People

Contributors

anandchowdhary avatar jayantkatia avatar nirmitjatana avatar sakshi-choudhary avatar upptime-bot avatar vikpe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Help Command

Add a help command for users to explore and configure upptime.

config cmd

config cmd to update and add settings to .uclirc.yml.

Generate summary/README

Get commits using

git log --pretty=format:"%h%x09%ad%x09%s" --date=default  --all --first-parent --remotes --reflog --author-date-order -- __filename__

calculate response times and generate readme

npm beta release

Release NPM beta release,

  • automate releases using GitHub Actions
  • understand the working of semantic-release bot
  • find solution to auto-update user's CLI tool without using S3 buckets.

calculate downtimes

Use the incidents properties to calculate downtime.
Add logic to /src/helpers/calculate-uptime.ts

additions to init cmd

TODOs

  • check whether .uclirc.yml already exists
  • check whether repository is git initialised
  • add all generated log files to .gitignore

Init Command

Add init command to initialize a new uclirc.yaml file with user configurations.

incidents file structure and helper functions

TL;DR

Use provider specific workflows/actions to sync issue created as files. Write workflows/actions specific to the platform and use the platform agonist tool.

Benefits

  1. No dependency on a specific api
  2. Integrations with any platform will be a breeze.

Implementation

Issues created as files by the tool will be pushed to the remote repo(if specified), actions will trigger on changes made to issues/*/*.md and will generate issues on remote.

issues/slugified-name/an-issue.md will have yaml front matter which will contain meta fields. Comments will be separated using md-comments, example <!--start:comment:1--> COMMENT <!--end:comment:2-->.

Since, the template will require seldom PRs. We can sync issue-numbers by defining actions which will be triggered on any newly created PR, and will increase the offset in the root level incidents.yml.

Possible Pit-falls

Syncing issue-numbers would be difficult with some providers. GitHub, for example, has discussions in which discussion gets a id. We may define actions for every created discussion, but discussion-actions are not available yet (though, it is on their road-map).

Questions

  1. Should we really sync issue-numbers?
  2. Keeping in mind, the benefits and possible pit-falls, is it a good way to do things?

additions to run cmd

TODOs:

  • Add spinners
  • Devise a mechanism to clear console at periodic intervals, or after say, 20 lines
  • Quiet mode

incidents command

This command will list all the incidents on the monitoring websites(default behavior)

  • reading the incidents file
  • display results in table
  • active flag
  • past incidents flag

refactor config cmd

Refactor config command,

  • make spawn editor code platform aware
  • ask user what to config using inquirer
  • add config options for .env

Generate graphs

Instead of relying on a separate graphs package, I propose including the functionality in here.

Benefits

  1. upptime/cli has helper functions required by Graphs func.
  2. Reduce overhead โ“
  3. dir /api is no longer needed to generate badges.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.