99* Validates configs via ** Dry::Schema** , failing fast on invalid YAML/JSON/Hash
1010* Supports ** signature validation** (default HMAC) and ** custom validator** classes
1111* Enforces ** request limits** (body size) and ** timeouts** , configurable at runtime
12- * Emits ** basic metrics events** for downstream integration
1312* Ships with operational endpoints:
1413
1514 * ** GET** ` <health_path> ` : liveness/readiness payload
16- * ** GET** ` <metrics_path> ` : JSON array of recent events
1715 * ** GET** ` <version_path> ` : current gem version
1816
1917* Boots a demo ` <root_path>/hello ` route when no config is supplied, to verify setup
@@ -52,7 +50,6 @@ Note: The `hooks` gem name is already taken on RubyGems, so this project is name
52504 . ** Operational Endpoints**
5351
5452 * ** Health** : liveness/readiness, config checksums
55- * ** Metrics** : JSON events log (last N entries)
5653 * ** Version** : gem version report
5754
58555 . ** Developer & Operator Experience**
@@ -114,7 +111,6 @@ export HOOKS_LOG_LEVEL=info
114111# Paths
115112export HOOKS_HANDLER_DIR=./handlers
116113export HOOKS_HEALTH_PATH=/health
117- export HOOKS_METRICS_PATH=/metrics
118114export HOOKS_VERSION_PATH=/version
119115
120116# Start the application
@@ -144,7 +140,6 @@ lib/hooks/
144140│ ├── config_loader.rb # Loads + merges per-endpoint configs
145141│ ├── config_validator.rb # Dry::Schema-based validation
146142│ ├── logger_factory.rb # Structured JSON logger + context enrichment
147- │ ├── metrics_emitter.rb # Event emitter for request metrics
148143│ └── signal_handler.rb # Trap SIGINT/SIGTERM for graceful shutdown
149144│
150145├── handlers/
@@ -197,7 +192,6 @@ request_timeout: 15 # seconds to allow per request
197192# Path configuration
198193root_path : /webhooks # base path for all endpoint routes
199194health_path : /health # operational health endpoint
200- metrics_path : /metrics # operational metrics endpoint
201195version_path : /version # gem version endpoint
202196
203197# Runtime behavior
@@ -215,7 +209,7 @@ endpoints_dir: ./config/endpoints # directory containing endpoint configs
215209 * Load endpoint configs via `config_loader`
216210 * Validate via `config_validator` (Dry::Schema); halt if invalid at boot
217211 * Initialize structured JSON logger via `logger_factory`
218- * Emit startup `:request_start` for `/health`, `/metrics`, `/version`
212+ * Emit startup `:request_start` for `/health` and `/version`
219213 * Trap SIGINT/SIGTERM for graceful shutdown
220214 * Build and return Rack app from `app/api.rb`
221215
@@ -225,7 +219,7 @@ endpoints_dir: ./config/endpoints # directory containing endpoint configs
225219 * Mounts:
226220
227221 * `<root_path>/hello` (demo)
228- * `<health_path>`, `<metrics_path>`, `<version_path>`
222+ * `<health_path>` and `<version_path>`
229223 * Each team endpoint under `<root_path>/<path>`
230224
2312253. **Router & Endpoint Builder**
@@ -241,12 +235,7 @@ endpoints_dir: ./config/endpoints # directory containing endpoint configs
241235 * **After**: run `on_response` plugins
242236 * **Rescue**: on exception, run `on_error`, rethrow or format JSON error
243237
244- 4. **Metrics Emitter**
245-
246- * Listen to lifecycle events, build in-memory ring buffer of last N events
247- * `/metrics` returns the JSON array of these events (configurable size)
248-
249- 5. **Graceful Shutdown**
238+ 4. **Graceful Shutdown**
250239
251240 * On SIGINT/SIGTERM: allow in-flight requests to finish, exit
252241
@@ -311,7 +300,7 @@ Each log entry includes standardized fields:
311300
312301---
313302
314- # # 📈 9. Metrics & Instrumentation
303+ # # 📈 9. Instrumentation
315304
316305Simple request logging for basic observability :
317306
@@ -519,13 +508,11 @@ The health endpoint provides comprehensive status information for load balancers
519508# ## Performance Considerations
520509
521510* **Thread Safety**: All core components are thread-safe for multi-threaded servers
522- * **Memory Management**: Configurable metrics buffer prevents unbounded memory growth
523511* **Graceful Degradation**: Framework continues operating even if individual handlers fail
524512
525513# ## Security Best Practices
526514
527515* Use strong secrets for signature validation
528- * Monitor and alert on unusual request patterns via metrics
529516* Keep handler code minimal and well-tested
530517
531518---
0 commit comments