Skip to content

Commit

Permalink
Update Actions and JSON Server (#23)
Browse files Browse the repository at this point in the history
* Update Actions and JSON Server

* Update README.md

* Update README.md
  • Loading branch information
mikhail-vl authored Dec 20, 2024
1 parent fc945ff commit 91f5c1a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,39 @@ The Business Intelligence provides an accessible platform for business users:
1. Start Grafana container

```
docker compose --profile grafana up
docker compose --profile grafana up -d
```

2. Create Service Account and update `GRAFANA_TOKEN` in the `.env` file.

3. Start the Business Engine, Timescale database, and Prometheus

```
docker compose --profile engine up
docker compose --profile engine up -d
```

4. Download and start the Business Studio from [Releases](https://github.com/VolkovLabs/business-intelligence/releases).
4. Start JSON Server to test Actions (optional)

5. Configure Actions and Alert Rules:
```
docker compose --profile actions up -d
```

5. Download and start the Business Studio from [Releases](https://github.com/VolkovLabs/business-intelligence/releases).

6. Configure Actions and Alert Rules:

- Use JSON server `http://json-server:3000` for HTTP Request Action to create event and message files when alert triggered.
- Use JSON server `http://json-server:3000` for HTTP Request Action to create event and message files when alert triggered if started.
- Use provisioned `Test Dashboard` for adding Alert Rules based on thresholds and Regex pattern.

![Engine Overview](https://raw.githubusercontent.com/VolkovLabs/business-intelligence/main/img/overview.png)

6. Check performance and Prometheus metrics using provisioned `Business Engine` dashboard.
7. Check performance and Prometheus metrics using provisioned `Business Engine` dashboard.

7. Stop the Business Intelligence platform
8. Stop the Business Intelligence platform

```
docker compose --profile engine down
docker compose --profile actions down
docker compose --profile grafana down
```

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ services:
volumes:
- ./json-server/events:/app/events
profiles:
- engine
- actions
2 changes: 1 addition & 1 deletion json-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const server = http.createServer(function (req, res) {
*/
fs.writeFile(
`./events/${fileName}.txt`,
JSON.stringify(parsedBody.message, null, 2),
parsedBody.message,
"utf-8",
(error) => {
if (error) {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"license": "Commercial",
"name": "business-intelligence",
"scripts": {
"start:actions": "docker compose --profile actions pull && docker compose --profile actions up",
"start:engine": "docker compose --profile engine pull && docker compose --profile engine up",
"start:grafana": "docker compose --profile grafana pull && docker compose --profile grafana up",
"stop:actions": "docker compose --profile actions down",
"stop:engine": "docker compose --profile engine down",
"stop:grafana": "docker compose --profile grafana down"
}
Expand Down

0 comments on commit 91f5c1a

Please sign in to comment.