feat: Add Elasticsearch Transform Metrics & Benchmarking (PR#2)#12
Merged
Conversation
Add quarkus-micrometer-registry-prometheus to enable metrics collection and Prometheus endpoint exposure. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Scheduled job polls Transform Stats API every 30s and exposes Micrometer gauges for documents processed, indexed, lag, state, and checkpoint timestamp for both workflow and task transforms. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add configuration for metrics collection with sensible defaults: - enabled=true (can be disabled to reduce ES load) - poll-interval=30s (balances freshness vs overhead) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Test profile reduces metrics poll interval from 30s to 5s to speed up integration tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add ElasticsearchTransformMetricsIT with helper methods for testing metrics collection. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add tests verifying: - Metrics are collected and updated - Prometheus endpoint exposes metrics - Metrics update periodically with new data All 3 tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add benchmark test class with helper methods for: - Bulk event insertion with terminal/non-terminal ratio - Age offset simulation for old events - Transform lag monitoring Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Benchmark verifies processing time stays constant as data grows: - Phase 1: 1K events - Phase 2: 11K events - Assert: < 50% processing time increase (vs 10x without smart filtering) Test passing with 1.00x increase (no slowdown). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Benchmark verifies lag stays low under load: - Insert 1K events rapidly - Monitor lag over 25 seconds - Assert: max lag < 100 documents, lag decreases over time Both performance tests passing (lag=14, 1.00x scaling). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive metrics documentation to TRANSFORM_OPTIMIZATION.md: - Exposed Prometheus metrics (processed, indexed, lag, state, checkpoint) - Grafana dashboard queries and alert rules - Troubleshooting guide for high lag and metrics issues Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add section explaining: - Prometheus metrics exposure - Configuration options - Grafana integration - Performance benchmarking Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add detailed implementation plan for Elasticsearch Transform Metrics & Benchmarking feature. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Adds Prometheus-compatible metrics for Elasticsearch transforms and comprehensive performance benchmarking to verify smart filtering scales efficiently.
Implementation
Metrics Collection
documents_processed- Total documents processeddocuments_indexed- Total documents indexedlag- Processing lag (processed - indexed)state- Transform state (0=stopped, 1=started, 2=failed, -1=unknown)last_checkpoint- Last checkpoint timestampConfiguration
Testing
Documentation
TRANSFORM_OPTIMIZATION.mdwith comprehensive metrics guideCLAUDE.mdwith metrics sectionPerformance Results
Scaling Test:
Lag Test:
Integration Test Results
Metrics Enabled:
/q/metricsMetrics Disabled:
Test Plan
/q/metricsBreaking Changes
None. Metrics are opt-in (enabled by default but can be disabled).
Dependencies
Added:
io.quarkus:quarkus-micrometer-registry-prometheus🤖 Generated with Claude Code