Skip to content

fix(observability): enforce bounds, fix sampling bug, add circuit-bre… - #1594

Merged
1nonlypiece merged 1 commit into
Disciplr-Org:mainfrom
praizeD10:feat/privacy-observability-bounds
Aug 30, 2026
Merged

fix(observability): enforce bounds, fix sampling bug, add circuit-bre…#1594
1nonlypiece merged 1 commit into
Disciplr-Org:mainfrom
praizeD10:feat/privacy-observability-bounds

Conversation

@praizeD10

Copy link
Copy Markdown
Contributor

…aker and diagnostics

closes #1558

privacy-logger: integrate requestLifecycle + observabilityState from upstream; add REDACT_MAX_KEYS/DEPTH/STRING_LENGTH bounds to redact(); truncate strings before regex to prevent ReDoS; skip health/metrics paths silently; tag slow requests (>5s) with level:warn + slow:true; finish handler is idempotent via lifecycle state guard.

tracing: fix OTEL_TRACES_SAMPLER_ARG assigned as string instead of parsed float — now uses parseFloat with NaN guard and [0,1] clamp; add MAX_PENDING_SPANS back-pressure (noop when buffer full); add MAX_SPAN_ATTRIBUTES/EVENTS caps on SpanImpl; add OTLPExporter circuit-breaker (5 failures -> 30s cooldown, resets on success).

httpMetrics: integrate observabilityState from upstream; add http_requests_in_flight gauge with double-decrement guard on close; add http_errors_total counter for 4xx/5xx alerting; add http_slow_requests_total counter for latency triage; wrap recordMetricsDirectly in try/catch per upstream atomicity invariant.

tests: rewrite co-located test files to cover bounds, adversarial inputs, lifecycle idempotency, circuit-breaker lifecycle, sampling rate clamping, in-flight double-decrement guard, slow-request tagging, and silent-path filtering.

…aker and diagnostics

Refs #

privacy-logger: integrate requestLifecycle + observabilityState from upstream; add REDACT_MAX_KEYS/DEPTH/STRING_LENGTH bounds to redact(); truncate strings before regex to prevent ReDoS; skip health/metrics paths silently; tag slow requests (>5s) with level:warn + slow:true; finish handler is idempotent via lifecycle state guard.

tracing: fix OTEL_TRACES_SAMPLER_ARG assigned as string instead of parsed float — now uses parseFloat with NaN guard and [0,1] clamp; add MAX_PENDING_SPANS back-pressure (noop when buffer full); add MAX_SPAN_ATTRIBUTES/EVENTS caps on SpanImpl; add OTLPExporter circuit-breaker (5 failures -> 30s cooldown, resets on success).

httpMetrics: integrate observabilityState from upstream; add http_requests_in_flight gauge with double-decrement guard on close; add http_errors_total counter for 4xx/5xx alerting; add http_slow_requests_total counter for latency triage; wrap recordMetricsDirectly in try/catch per upstream atomicity invariant.

tests: rewrite co-located test files to cover bounds, adversarial inputs, lifecycle idempotency, circuit-breaker lifecycle, sampling rate clamping, in-flight double-decrement guard, slow-request tagging, and silent-path filtering.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@praizeD10 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@1nonlypiece
1nonlypiece merged commit 4b05435 into Disciplr-Org:main Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quality][Medium] Improve privacy-safe observability and tracing: bounded performance and operational visibility

2 participants