https://github.com/hyperjumptech/monika
Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. Get alert not only when your site is down but also when it's slow.
https://github.com/hyperjumptech/monika
cli monitoring nodejs synthetic-monitoring typescript
Last synced: 26 days ago
JSON representation
Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. Get alert not only when your site is down but also when it's slow.
- Host: GitHub
- URL: https://github.com/hyperjumptech/monika
- Owner: hyperjumptech
- License: mit
- Created: 2021-03-09T09:39:19.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T07:22:02.000Z (26 days ago)
- Last Synced: 2025-04-11T04:58:52.824Z (26 days ago)
- Topics: cli, monitoring, nodejs, synthetic-monitoring, typescript
- Language: TypeScript
- Homepage: https://monika.hyperjump.tech
- Size: 22.8 MB
- Stars: 609
- Watchers: 12
- Forks: 68
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCTS.md
Awesome Lists containing this project
- awesome-faker - monika - Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. (Projects using `@faker-js/faker`)
- awesome-github-star - monika
- awesome-starred - hyperjumptech/monika - Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. Get alert not only when your site is down but also when it's slow. (typescript)
README
# 
[](https://github.com/hyperjumptech/monika/actions) [](https://codecov.io/gh/hyperjumptech/monika) [](https://www.npmjs.com/package/@hyperjumptech/monika) [](https://www.npmjs.com/package/@hyperjumptech/monika) [](https://hub.docker.com/r/hyperjump/monika)
## About
Monika is a command line application for synthetic monitoring. The name Monika stands for "**Moni**toring Ber**ka**la", which means "periodic monitoring" in the Indonesian language.
## How to Use
You can find many ways to install Monika and how to start monitoring from the [Quick Start page](https://monika.hyperjump.tech/quick-start).
## Contributing
Monika is a Node.js application written in TypeScript using the [oclif framework](https://oclif.io/).
It was developed on **node 20 (LTS)**, and **npm v10**.To start developing, clone this repository, then install the dependencies:
```bash
git clone [email protected]:hyperjumptech/monika.git
npm ci
npm run build -w packages/notification
```Then, to run Monika from the source,
- on Linux/Unix/Mac
```bash
npm start
```- on Windows
```bash
.\bin\dev.cmd
```To keep the formatting consistent, run the following command to format the source code:
```bash
npm run format
```Finally you can also run `npm run test` to prevent regression.
Once you have made the changes, open a Pull Request and explain the issue your change will fix or the feature your change will add.
For contribution details on how to add custom notifications [see the New Notifications guide here](https://monika.hyperjump.tech/guides/new-notifications).
### Applying changes in monorepo workspaces folder (`packages/notification`)
If you are developing feature/fix related to notification by making changes inside the `packages/notification` folder, it's easier to temporarily change the dependency source in `package.json` to be like this
```json
"@hyperjumptech/monika-notification": "*"
```it will sync `@hyperjumptech/monika-notification` package `node_modules` to any changes in the `packages/notification` folder without running build on every code change.
See this [docs](https://turbo.build/repo/docs/handbook/workspaces#workspaces-which-depend-on-each-other) for further detail
### How to Test Probe Locally
If you need to test a probe locally, there are predefined services in `/dev/docker-compose.yaml`. You are **encouraged** to add other services that can be probed by Monika. Run `cd dev && docker compose up` to run those services.
#### Available Services
Use the following Monika config to probe the service.
##### HTTPBin
```yaml
probes:
- id: 'should not follow redirect'
requests:
- url: http://localhost:3000/status/302
followRedirects: 0
alerts:
- assertion: response.status != 302
message: You should not follow the redirect
- id: 'should follow redirect with default config'
requests:
- url: http://localhost:3000/absolute-redirect/20
alerts:
- assertion: response.status == 302
message: You are not following the redirect
- id: 'should follow redirect with customized config'
requests:
- url: http://localhost:3000/status/302
followRedirects: 2
alerts:
- assertion: response.status == 302
message: You are not following the redirect
```##### MariaDB
```yaml
probes:
- id: mariadb
mariadb:
- host: localhost
port: 3306
username: mariadb_user
password: mariadb_password
database:
```##### MySQL
```yaml
probes:
- id: mysql
mysql:
- host: localhost
port: 3307
username: mysql_user
password: mysql_password
database:
```##### MongoDB
```yaml
probes:
- id: mongo
mongo:
- uri: mongodb://mongo_user:mongo_password@localhost:27017
```##### PostgreSQL
Use the following Monika config to probe the service.
```yaml
probes:
- id: postgres
postgres:
- uri: postgres://postgres_user:postgres_password@localhost:5432/postgres_db
```##### Redis
```yaml
probes:
- id: redis
redis:
- uri: redis://:redis_password@localhost:6379
```### How to Monitor Monika Locally
1. Run [Prometheus](https://prometheus.io/). Run `docker compose -f ./dev/prometheus/docker-compose.yaml up`.
2. Run Monika with the Prometheus flag. Run `npm start -- --prometheus 3001`.
3. Open Prometheus [Expression Browser](https://prometheus.io/docs/visualization/browser/). Visit `http://localhost:9090/graph`.## Development References
The tools and frameworks we used in this project are listed below:
- [oclif](https://oclif.io/) to scaffold the CLI.
- [Prettier](https://prettier.io/) to format the code.
- [ESLint](https://eslint.org/) to statically analyze the code to quickly find problems.
- [Mocha](https://mochajs.org/) for testing.
- [Istanbul](https://istanbul.js.org/) for code coverage.## Discussions
If you need help, want to give feedback, or have a great idea to improve Monika, get involved! Let us know in the [Github discussions](https://github.com/hyperjumptech/monika/discussions).
Please abide by the [Contributor's Code of Conduct](CODE_OF_CONDUCTS.md)
## Further information
For detailed information, you can click on any of the specific docs below:
- [Quick Start](https://hyperjumptech.github.io/monika/quick-start)
- [Installations](https://monika.hyperjump.tech/quick-start#installation)
- [How it works](https://hyperjumptech.github.io/monika/guides/probes)[](https://www.producthunt.com/posts/monika-2?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-monika-2)
## License
[MIT](./LICENSE.txt) License.