Skip to content

Commit 7fc111a

Browse files
authored
Merge pull request #7 from wavezync/chore/readme
2 parents 6cbb99b + b294e57 commit 7fc111a

File tree

3 files changed

+162
-9
lines changed

3 files changed

+162
-9
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
PULSE_BRIDGE_CONFIG=config.yml
1+
PULSE_BRIDGE_CONFIG=config.yml
2+
PORT=8080
3+
HOST=0.0.0.0

README.md

Lines changed: 158 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,163 @@
11
# Pulse Bridge
22

3-
Pulse Bridge is a powerful uptime monitoring tool designed to bridge the gap between your internal infrastructure and external status monitoring platforms. Whether you're running services in a Kubernetes cluster or managing a distributed system, Pulse Bridge ensures real-time exposure of service health via HTTP, keeping your monitoring tools like Atlassian Statuspage, PagerDuty, or custom dashboards up to date.
3+
Pulse Bridge is a lightweight, powerful uptime monitoring tool for your internal infrastructure (APIs, databases, etc.) and external platforms.
44

5-
With Pulse Bridge, you get:
5+
## How it works
66

7-
- 🚀 Seamless Integration – Effortlessly sync internal service status with external monitoring tools.
8-
- 📡 Real-Time Insights – Stay ahead with instant updates on uptime, downtime, and incidents.
9-
- 🔗 Flexible & Scalable – Works across cloud-native and on-premise environments.
10-
- 🛡 Reliable & Secure – Built with stability and security in mind for mission-critical applications.
7+
Simply create a configuration file to define multiple services and databases to be checked at custom intervals. Pulse Bridge records the health status of each service and database, and provides a simple HTTP API to query their status.
118

12-
Keep your systems transparent, your teams informed, and your users confident with Pulse Bridge – the heartbeat of your service health monitoring. 💙⚡
9+
#### Currently supports
10+
11+
## Monitoring
12+
13+
CLI > .env
14+
15+
16+
17+
## Configuration
18+
19+
The configuration file is a YAML file where you can define the services and databases you want to monitor.
20+
21+
Database monitors can be configured using a connection string or individual parameters (host, port, username, password, database name). The `driver` field is required to specify the database type (e.g., `postgres`, `mysql`, `mariadb`, `mssql`, `redis`).
22+
23+
You may also include a `query` field to run a custom SQL query for health checks, but it is not required.
24+
25+
Example configuration:
26+
27+
```yaml
28+
monitors:
29+
# HTTP service monitoring
30+
- name: "HTTP Service"
31+
type: "http"
32+
interval: "30s"
33+
timeout: "5s"
34+
http:
35+
url: "http://helloworld-http:8080/ping"
36+
method: "GET"
37+
headers:
38+
Authorization: "Bearer secret-token"
39+
Content-Type: "application/json"
40+
41+
# Postgres monitoring
42+
- name: "PostgreSQL Service"
43+
type: "database"
44+
interval: "30s"
45+
timeout: "10s"
46+
database:
47+
driver: "postgres"
48+
connection_string: "postgres://postgres:postgres@postgres-db:5432/monitoring?sslmode=disable"
49+
query: "SELECT 1"
50+
51+
# MySQL monitoring
52+
- name: "MySQL Service"
53+
type: "database"
54+
interval: "30s"
55+
timeout: "10s"
56+
database:
57+
driver: "mysql"
58+
connection_string: "root:mysql@tcp(mysql-db:3306)/monitoring"
59+
query: "SELECT 1"
60+
61+
# MariaDB monitoring
62+
- name: "MariaDB Service"
63+
type: "database"
64+
interval: "30s"
65+
timeout: "10s"
66+
database:
67+
driver: "mariadb"
68+
connection_string: "root:mariadb@tcp(mariadb-db:3306)/monitoring"
69+
query: "SELECT 1"
70+
71+
# Redis monitoring
72+
- name: "Redis Service Primary"
73+
type: "database"
74+
interval: "5s"
75+
timeout: "5s"
76+
database:
77+
driver: "redis"
78+
database: "1"
79+
host: "redis-db"
80+
port: 6379
81+
password: "redispassword"
82+
83+
# MSSQL monitoring
84+
- name: "MSSQL Service"
85+
type: "database"
86+
interval: "30s"
87+
timeout: "10s"
88+
database:
89+
driver: "mssql"
90+
host: "mssql-db"
91+
port: 1433
92+
username: "SA"
93+
password: "Password1!"
94+
database: "master"
95+
query: "SELECT 1"
96+
```
97+
98+
## Monitoring
99+
100+
You can check the status of your service from the pulse bridge API at the routes:
101+
102+
103+
#### /monitor/services
104+
- List all monitored services
105+
106+
```json
107+
[
108+
{
109+
"service": "HTTP Service",
110+
"status": "healthy",
111+
"type": "http",
112+
"last_check": "2025-07-24 11:56:01.918452021 +0000 UTC m=+0.357002662",
113+
"last_success": "2025-07-24 11:56:01.918443897 +0000 UTC m=+0.356994537",
114+
"metrics": {
115+
"response_time_ms": 81,
116+
"check_interval": "30s",
117+
"consecutive_successes": 1
118+
},
119+
"last_error": ""
120+
},
121+
{
122+
"service": "PostgreSQL Service",
123+
"status": "unhealthy",
124+
"type": "database",
125+
"last_check": "2025-07-24 11:56:01.891732112 +0000 UTC m=+0.330282750",
126+
"last_success": "",
127+
"metrics": {
128+
"response_time_ms": 50,
129+
"check_interval": "30s",
130+
"consecutive_successes": 0
131+
},
132+
"last_error": "failed to ping database: dial tcp 172.23.0.3:5432: connect: connection refused"
133+
}
134+
]
135+
```
136+
137+
#### /monitor/services/{monitor_name}
138+
- Get details of a specific service
139+
140+
```json
141+
{
142+
"service": "MariaDB Service",
143+
"status": "unhealthy",
144+
"type": "database",
145+
"last_check": "2025-07-24 11:56:01.89172233 +0000 UTC m=+0.330272963",
146+
"last_success": "",
147+
"metrics": {
148+
"response_time_ms": 33,
149+
"check_interval": "30s",
150+
"consecutive_successes": 0
151+
},
152+
"last_error": "failed to ping database: dial tcp 172.23.0.7:3306: connect: connection refused"
153+
},
154+
```
155+
156+
## Contributing
157+
158+
We welcome contributions! If you have ideas, bug fixes, or improvements, please open an issue or submit a pull request.
159+
160+
161+
162+
163+
Keep your systems transparent, your teams informed, and your users confident with Pulse Bridge – the heartbeat of your infrastructure. 🌊

internal/env/env_loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Init() *Config {
1717

1818
func loadConfig() {
1919
AppConfig = Config{
20-
ConfigPath: GetEnv("PULSE_BRIDGE_CONFIG", ""),
20+
ConfigPath: GetEnv("PULSE_BRIDGE_CONFIG", "config.yml"),
2121
Host: GetEnv("HOST", "0.0.0.0"),
2222
Port: GetEnvInt("PORT", 8080),
2323
}

0 commit comments

Comments
 (0)