fix(observability): enforce bounds, fix sampling bug, add circuit-bre… - #1594
Merged
1nonlypiece merged 1 commit intoAug 30, 2026
Merged
Conversation
…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.
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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.