{"id":26656441,"url":"https://github.com/foxbot/glance","last_synced_at":"2025-04-11T11:08:22.408Z","repository":{"id":46832754,"uuid":"130587836","full_name":"foxbot/glance","owner":"foxbot","description":"The at-a-glance Discord bot status dashboard","archived":false,"fork":false,"pushed_at":"2021-05-05T22:34:31.000Z","size":40,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T07:35:11.817Z","etag":null,"topics":["discord-bot","statuspage"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-22T16:53:47.000Z","updated_at":"2023-01-24T18:43:04.000Z","dependencies_parsed_at":"2022-08-20T13:50:58.410Z","dependency_job_id":null,"html_url":"https://github.com/foxbot/glance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxbot%2Fglance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxbot%2Fglance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxbot%2Fglance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxbot%2Fglance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxbot","download_url":"https://codeload.github.com/foxbot/glance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381761,"owners_count":21094525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-bot","statuspage"],"created_at":"2025-03-25T07:29:57.872Z","updated_at":"2025-04-11T11:08:22.388Z","avatar_url":"https://github.com/foxbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glance\nThe at-a-glance Discord bot status dashboard.\n\n## Features\n\nGlance is intended to be used by large, multi-process Discord bots, where keeping\ntabs on bot status becomes more complicated than just checking the user's status\non Discord.\n\nThe simple user-interface provided by Glance makes it a compelling status page to\noffer as part of your bot's public status page, allowing your end users to quickly\ncheck the bot's status in their guild.\n\nShards are shown in a grid, with the status of the shard being indicated by universally\nunderstood traffic-light colors\u003csup\u003e[1](https://pdfs.semanticscholar.org/738b/fe8606a556e0a1fe85686c5c20616a1013dd.pdf)\u003c/sup\u003e.\n\nA search bar is provided at the top of the page where a user may enter their Guild ID.\nGlance will then locate that guild in each bot cluster using Discord's standard guild\nselection algorithm, and highlight the shard in the list. This allows users to easily\nlocate the status of the bot in a multi-sharded, multi-cluster configuration.\n\n![Glance Screenshot](https://i.foxbot.me/9v5ijLF.png)\n\n### Non-features\n\nGlance provides a very basic level of data-collection using push-based metrics. This\nallows the status page to determine the live status of the shard, and mark a shard as\nunhealthy when it has not been regularly publishing its status.\n\nThe limited nature of Glance's data collection means that Glance is not a replacement\nfor a more complete data-visualization package, such as Grafana. While Glance can be\nvery helpful for your bot's support team, or even for your developers/ops team to reference,\nit does not replace the infinitely more powerful visualization and alerting that a\ntime-series database paired with Grafana is capable of.\n\n## Installation\n\nGlance requires the following:\n\n- Python 3.7\n- Optionally, an ASGI-compatible Web Server\n\n`$ pip -r requirements.txt`\n\n### Configuration\n\nCopy the `.env.sample` file to `.env`, or, export the environment variables yourself.\n\nSee [`.env.sample`](./.env.sample) for documentation on how to set configuration flags. Additionally,\nyou may [configure the integrated server](https://sanic.readthedocs.io/en/latest/sanic/config.html#builtin-configuration-values)\nwith environment variables.\n\n### Deployment\n\nGlance is composed of a Python web-server and a single static-page site. The static-page, located\nat `./index.html` and `assets/` can be served directly, with minimal changes (see below). The API\nmust be served through a WSGI-compatible web-server, or using the out-of-box integrated server.\n\n#### Interated Server\n\n`$ python3 app.py`\n\nGlance and its API will be accessible at the address specified in the configuration.\n\n#### WSGI/ASGI Server\n\nSee [Sanic's documentation](https://sanic.readthedocs.io/en/latest/sanic/deploying.html#running-via-asgi)\non this subject.\n\nYes, WSGI through Gunicorn is supported.\n\n**Note:** you may need to configure the frontend differently when using an external server,\nas it will try to find the socket from a fixed location. The `noscript` link also assumes\nuse of the integrated server, if that's an edge case you care to fix.\n\n## Usage\n\nBots wishing to push data to Glance must post data to the Glance API both when the shard\nstate is updated, and at (around) the specified health interval.\n\nBy default, the health interval is set to 30 seconds (i.e., the bot must contact Glance every\n30 seconds, lest it be considered unhealthy). It may make more sense in your environment\nto configure this value as 45 seconds, and post a health check every heartbeat.\n\nYou may also want to account for other data before sending a health check, such as whether\nor not the shard is receiving a normal amount of messages from the gateway. This might help\nyou to identify if a shard is in a zombie state (i.e., your library has deadlocked, or has lost\ntrack of its connection state) and display a status update accordingly.\n\nNote: If a shard is marked as unhealthy, and Glance receives a status update for it, the shard \nwill then be marked as ONLINE; not whichever state it was in prior to going unhealthy. This may\nbe something to consider before sending health checks.\n\n### Frontend Configuration\n\nYou are free\u003csup\u003e*\u003c/sup\u003e to modify the header of `index.html` to include your branding (the intended location\nis where `foxbot.me` is located in `.header-author`, though you can place it anywhere). \n\nClass names and element IDs are how the site's pure-vanilla scripting works, so be aware that changing\nthem will likely break the site.\n\nAll colors and fonts used on the frontend may be adjusted via `assets/main.css`. I don't load any fonts\nfrom the internet by default, so you can work that out on your own.\n\n**If you are running Glance outside of the integrated server**, you will need to adjust the `getSocketUrl`\nmethod under `assets/index.js`. The frontend will not be able to connect to the API if you don't\nadjust this.\n\n\u003csmall\u003e*\"free\" as in \"encouraged\". This statement carries no implications on licensing; please see the\n`LICENSE` for licensing guarantees.\u003c/small\u003e\n\n### API Documentation\n\nIf Glance is configured with `GLANCE_PASSPHRASE`, requests to the following endpoints must have\ntheir `Authorization` header set accordingly.\n\n##### Shard State Enumeration\n| Status Name | Value |\n| --- | --- |\n| Unknown | 0 |\n| Unhealthy | 1 |\n| Offline | 2 |\n| Online | 3 |\n| Starting | 4 |\n| Stopping | 5 |\n| Resuming | 6 |\n\nNote: shard states generally have no real meaning, and are generally only used to\nset the color of the shard on the Glance grid.\n\nThe unknown, unhealthy, and online states are used internally by Glance. Shards are\ninitialized with the unknown state, will toggle to unhealthy when the health check\ninterval has been exceeded, and will toggle back to online if a health check is\nreceived for an unhealthy shard.\n\n#### `POST /api/status/\u003ccluster\u003e/\u003cid:int\u003e/\u003cstate:int\u003e`\nThis endpoint sets the state for a given shard.\n\n##### Parameters\n`cluster`: The name of the cluster this shard is on; this should match up with the cluster names in the configuration.\n\n`id`: The zero-indexed ID of this shard.\n\n`state`: The numeric Shard State of this shard; see above.\n\n#### `POST /api/health/\u003ccluster\u003e/\u003cid:int\u003e`\nThis endpoint marks a shard as healthy.\n\n##### Parameters\n`cluster`: The name of the cluster this shard is on; this should match up with the cluster names in the configuration.\n\n`id`: The zero-indexed ID of this shard.\n\n## License\nGlance is licensed under ISC. See the [LICENSE](./LICENSE.md), located at `LICENSE.md`\n\n## Contributing\n1. Please open an issue or contact me before opening a merge request.\n2. Adhere to the standards set in the `.editorconfig`.\n3. All changes should make the code better in some way. See http://suckless.org/philosophy/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxbot%2Fglance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxbot%2Fglance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxbot%2Fglance/lists"}