-
Notifications
You must be signed in to change notification settings - Fork 0
Implement observability features (metrics, logging, health checks) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #26
⏳ Usage Limit ReachedThe automated solution draft was interrupted because the Claude usage limit was reached. 📊 Limit Information
🔄 How to ContinueOnce the limit resets at 1:00 AM, you can resume this session by running: (cd "/tmp/gh-issue-solver-1768772124417" && claude --resume 038ba033-c705-4c6d-b089-21ce1e7a9572 --model opus)📎 Execution log uploaded as Gist (1842KB) This session was interrupted due to usage limits. You can resume once the limit resets. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-19T00:00:49.792Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
|
|
Ensure all changes are correct, consistent and fully meet the requirements. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-20T22:36:32.117Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Adds comprehensive observability module for both JavaScript and Rust implementations: JavaScript (js/src/observability/): - metrics.js: Counter, Gauge, LatencyHistogram, QueueMetrics, MetricsRegistry - prometheus.js: PrometheusExporter with Prometheus exposition format - logger.js: Structured logging with JSON/text formats, log rotation, correlation IDs - health.js: HealthChecker with liveness/readiness endpoints, component health Rust (rust/src/observability/): - metrics.rs: Thread-safe Counter, Gauge, LatencyHistogram with atomics - prometheus.rs: PrometheusExporter for Prometheus-compatible metrics export - logger.rs: Structured logging with LogLevel, LogContext, JSON/text formats - health.rs: HealthChecker with liveness/readiness, component health details Features implemented per REQUIREMENTS.md: - REQ-OBS-001: Queue depth metrics - REQ-OBS-002: Throughput metrics (enqueue/dequeue rates) - REQ-OBS-003: Latency histograms with percentiles (p50, p90, p95, p99) - REQ-OBS-004: Consumer lag metrics - REQ-OBS-010: Configurable log levels (DEBUG, INFO, WARN, ERROR, FATAL) - REQ-OBS-011: Correlation IDs for request tracing - REQ-OBS-012: Structured logging (JSON format) - REQ-OBS-020: Liveness endpoint - REQ-OBS-021: Readiness endpoint - REQ-OBS-022: Backend connectivity health checks Closes #26 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add safeGetEnv() helper to gracefully handle env access without --allow-env in Deno - Refactor Logger tests to use inline setup/teardown instead of beforeEach/afterEach (not supported by Deno's node:test) - Update CI workflow to include --allow-env and --allow-write flags for Deno tests (needed for tmpdir() and file operations) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add module-level allow attributes for various Clippy lints in observability module - Format code with cargo fmt - Refactor prometheus.rs to use vec![] macro instead of Vec::new() + push - Add const fn to content_type() method Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Allow unreadable_literal, redundant_closure, cast_lossless, float_cmp for test code compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Implementation CompleteAll observability features have been implemented and CI is passing. SummaryJavaScript Implementation (
Rust Implementation (
CI Status
Requirements CoverageAll requirements from REQUIREMENTS.md (REQ-OBS-001 through REQ-OBS-022) are implemented:
Ready for review! 🚀 |
This reverts commit a19cc7b.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Implements comprehensive observability features for both JavaScript and Rust implementations, addressing all requirements from REQUIREMENTS.md (REQ-OBS-001 through REQ-OBS-022).
JavaScript Implementation (
js/src/observability/)metrics.js: Core metrics primitives
Counter,Gauge,LatencyHistogramwith percentile calculationsQueueMetricsfor queue-specific metricsMetricsRegistryfor managing multiple metricsprometheus.js: Prometheus-compatible export
PrometheusExporterwith text format outputmetricsMiddlewarefor Express/Fastify integrationlogger.js: Structured logging
Loggerwith JSON/text format supportLogContextfor correlation ID tracking via AsyncLocalStoragehealth.js: Health checking
HealthCheckerwith liveness/readiness endpointsComponentCheckerfor individual component healthhealthMiddlewarefor Express/Fastify integrationRust Implementation (
rust/src/observability/)metrics.rs: Thread-safe metrics using atomics
Counter,GaugewithAtomicU64for lock-free operationsLatencyHistogramwith bucket-based distributionQueueMetrics,MetricsRegistrywithRwLockprometheus.rs: Prometheus text format export
PrometheusExporterwith standard format outputlogger.rs: Structured logging
LoggerwithLogLevel,LogFormat(JSON/Text)LogContextfor thread-local correlation IDshealth.rs: Health checking
HealthCheckerwith async component checksComponentHealth,LivenessResult,ReadinessResultRequirements Addressed
Test plan
Closes #26
🤖 Generated with Claude Code