You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-38Lines changed: 8 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,53 +176,23 @@ go run main.go
176
176
177
177
Then visit http://localhost:8080/metrics to see the exported metrics.
178
178
179
-
## Long-Running Test for Prometheus + Grafana
179
+
## Long-Running Test
180
180
181
-
A comprehensive long-running test is available to generate realistic authorization traffic for testing Prometheus and Grafana integration. This test simulates real-world scenarios based on classic access control models:
181
+
A long-running test simulates RBAC, ABAC, and ReBAC authorization patterns for testing with Prometheus and Grafana.
182
182
183
-
- **RBAC (Role-Based Access Control)** - Users with different roles (admin, developer, viewer, guest) accessing various resources
184
-
- **ABAC (Attribute-Based Access Control)** - Access decisions based on user attributes (department, clearance level) and resource attributes (classification, owner)
185
-
- **ReBAC (Relationship-Based Access Control)** - Access decisions based on relationships between users and resources (ownership, organization membership)
186
-
187
-
### Running the Long-Running Test
188
-
189
-
To start the long-running test:
183
+
### Usage
190
184
191
185
```bash
192
186
go test -v -run TestLongRunning -timeout 0
193
187
```
194
188
195
-
The test will:
196
-
- Start a Prometheus metrics endpoint on `http://localhost:8080/metrics`
197
-
- Continuously generate authorization events at a controlled rate (~50-150 requests/second)
198
-
- Simulate realistic allow/deny patterns based on access control rules
199
-
- Generate policy operation events periodically
200
-
- Run indefinitely until interrupted with Ctrl+C
201
-
202
-
**Note**: The test is designed to be resource-friendly and will not consume excessive CPU or memory. It includes controlled rate limiting with random delays between requests to simulate realistic traffic patterns.
203
-
204
-
### Using with Prometheus and Grafana
205
-
206
-
1. Start the long-running test in one terminal:
207
-
```bash
208
-
go test -v -run TestLongRunning -timeout 0
209
-
```
210
-
211
-
2. Configure Prometheus to scrape the metrics endpoint (see [Prometheus + Grafana Setup](#prometheus--grafana-setup) above)
212
-
213
-
3. Import the provided Grafana dashboard to visualize the metrics in real-time
189
+
The test generates ~50-150 requests/second and exposes metrics on `http://localhost:8080/metrics`. Press Ctrl+C to stop.
214
190
215
-
4. Observe the metrics being updated continuously, showing:
216
-
- Authorization request rates and patterns
217
-
- Allow/deny distributions across different domains
218
-
- Request latency distributions
219
-
- Policy operation metrics
191
+
### Integration with Prometheus/Grafana
220
192
221
-
This test is ideal for:
222
-
- Testing Prometheus scraping configuration
223
-
- Validating Grafana dashboard functionality
224
-
- Demonstrating the logger with realistic traffic
225
-
- Performance testing of the metrics collection pipeline
193
+
1. Start the test
194
+
2. Configure Prometheus to scrape `localhost:8080/metrics`
195
+
3. Import the Grafana dashboard from `grafana-dashboard.json`
0 commit comments