feat(log-ingestor): Add realtime OTLP log ingestion#2329
Draft
junhaoliao wants to merge 3 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ime-log-ingestion # Conflicts: # components/webui/client/src/pages/SearchPage/SearchControls/Native/SearchButton/SubmitButton/index.tsx # components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Native/NativeResultsTimeline.tsx # components/webui/common/src/schemas/search.ts # components/webui/server/src/routes/api/search/index.ts
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.
Description
This PR adds a v1 realtime log ingestion path for CLP-S:
log-ingestorcan receive OTLP/HTTP logs at/v1/logs, normalize OTLP records into JSONL, and persist them into filesystem-backed hot segments.hot_log_segments, including committed byte offsets, record counts, timestamp ranges, and segment lifecycle state.log-ingestor, query workers, and compression workers.realtime-logs-plan.mddocuments the implementation plan, v1 limitations, delivery semantics, and validation instructions. Package validation must usebuild/clp-package/sbin/start-clp.shandbuild/clp-package/sbin/stop-clp.sh; do not use rawdocker compose up/downfor package lifecycle validation.V1 limitations:
log-ingestor, query workers, and compression workers.log-ingestorauth, direct JSONL ingestion, Fluent Bit integration, and object-storage hot segments are future work.Impact Assessment
This affects
log-ingestor, the package config schema, orchestration DB initialization, query scheduling/task dispatch, API/WebUI search request handling, Docker Compose deployment, and Helm deployment. The change is needed so freshly ingested structured logs can become searchable before they are compacted into CLP-S archives.The main runtime implication is a new shared hot-storage volume and SQL metadata table. Ingestion success means records have been appended and flushed to the hot segment file; query workers only search up to the SQL-published
committed_end_offset. The system provides at-least-once ingestion semantics: acknowledged records should not be lost under the v1 durability policy, but duplicate upstream delivery can still produce duplicate records unless a future dedupe layer is added.Operationally, realtime log ingestion is independent of S3 ingestion and anonymous telemetry. The OpenTelemetry Collector can forward logs to
log-ingestor, but it is not responsible for writing CLP hot segment files.Checklist
Validation performed
Task: Stop the existing package before rebuilding
Command:
Output:
Explanation: Stopped the running package through the package script before rebuilding. This avoids using raw Docker Compose lifecycle commands.
Task: Build the CLP package with CPU-matched build parallelism
Command:
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task packageOutput:
Explanation: Rebuilt the package after Rust/TypeScript autofix.
getconf _NPROCESSORS_ONLNreturned8, so C++ package build tasks ran with parallelism8.Task: Start the rebuilt package
Command:
Output:
Explanation: Started the rebuilt package through
sbin/start-clp.shwith realtime logs enabled inbuild/clp-package/etc/clp-config.yaml.Task: Compress archive data for mixed hot/archive search
Command:
Output:
Task: Verify
log-ingestorand API healthCommand:
Output:
Task: Ingest one realtime OTLP/HTTP JSON log
Command:
Output:
Task: Verify hot JSONL storage and SQL metadata
Command:
Output:
Explanation: The OTLP record was normalized into hot JSONL, and SQL published a searchable committed offset for the open hot segment.
Task: Verify mixed hot/archive search through the WebUI API
Command:
Output:
Command:
Output:
Explanation: The search job selected both a hot JSONL segment target and a CLP-S archive target. The aggregation job selected only the archive target.
Task: Verify mixed hot/archive results in Mongo results cache
Command:
Output:
Task: Verify the browser WebUI search flow with
playwright-cliCommand:
Output:
Command:
Output:
Explanation: The browser-driven WebUI search found the hot OTLP record and archived PostgreSQL records in one query.
Task: Verify browser-submitted mixed query target selection and results cache
Command:
Output:
Command:
Output:
Task: Stop the package after validation
Command:
Output:
Task: Rust lint/autofix and formatting
Command:
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task lint:fix-rustOutput:
Task: JavaScript/TypeScript lint autofix
Command:
Output:
Task: Python validation
Command:
Output:
Explanation: The repo-level Python autofix task is blocked by the current
mysql-connector-pythonwheel availability for local CPython 3.12. The generated.venvundercomponents/clp-mcp-serverwas removed after this failure.Command:
Output:
Task: YAML lint
Command:
Output:
Task: Helm package and lint
Command:
CLP_CPP_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task helm:packageOutput:
Command:
Output:
Explanation: Helm packaging succeeds. Helm lint is blocked by the chart-testing version-bump policy because this local branch has not bumped
tools/deployment/package-helm/Chart.yaml.Task: Whitespace check
Command:
Output: