Skip to content

feat(metrics): emit per-request metrics on the pass-through path - #80

Merged
rennf93 merged 2 commits into
masterfrom
feat/request-metrics
Oct 15, 2026
Merged

rennf93 merged 2 commits into
masterfrom
feat/request-metrics

Conversation

@rennf93

@rennf93 rennf93 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #79

  • feat(metrics): GuardTransform::with_metrics(MetricsCollector). A response the next service produces for a request the guard let through emits the reference collect_request_metrics samples: request_count, response_time (from the request reaching the guard until the response head is back, like the reference stopping at response start) and error_rate for a >= 400 status, tagged with the path and method. Guard blocks and exclude_paths bypasses emit nothing. The collector owns the agent_enable_metrics gate and the transport, and the transform owns no agent slot, so the caller supplies the collector.
  • fix(config): the DetectionExclusionConfig literal in from_security_config now spreads ..DetectionExclusionConfig::default(). The open guard-core-rs PR fix(detection): port the verified guard-core reference fixes (passive log reason, semantic header opt-out, Cookie pair scan) guard-core-rs#137 adds a field to that struct, and this keeps the adapter compiling against both the current engine and the new one.

Add GuardTransform::with_metrics(MetricsCollector). A response the next service produces for a request the guard let through now emits the reference collect_request_metrics samples: request_count, response_time (stopping when the response head is back, like the reference stopping at response start) and error_rate for a >= 400 status. Guard blocks and exclude_paths bypasses emit nothing.
…syntax

The guard-core-rs engine is adding fields to DetectionExclusionConfig. The spread keeps this literal compiling against both the current engine and the one with the new field.
@rennf93
rennf93 force-pushed the feat/request-metrics branch from aa60b2e to c33e03d Compare October 15, 2026 04:49
@github-actions github-actions Bot added the area: lib Touches src/ (actix-web adapter — currently a single-file lib stub) label Oct 15, 2026
@rennf93
rennf93 merged commit 5876bee into master Oct 15, 2026
10 checks passed
@rennf93
rennf93 deleted the feat/request-metrics branch October 15, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: lib Touches src/ (actix-web adapter — currently a single-file lib stub)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(metrics): emit per-request metrics on the pass-through path

1 participant