Skip to content

remove fluent bit, use otel-collector for ingestion scripts - #1745

Merged
nikhilsinhaparseable merged 3 commits into
parseablehq:mainfrom
nikhilsinhaparseable:use-otel-collector-ingestion
Aug 9, 2026
Merged

remove fluent bit, use otel-collector for ingestion scripts#1745
nikhilsinhaparseable merged 3 commits into
parseablehq:mainfrom
nikhilsinhaparseable:use-otel-collector-ingestion

Conversation

@nikhilsinhaparseable

@nikhilsinhaparseable nikhilsinhaparseable commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Replaced Fluent Bit with the OpenTelemetry Collector for host metrics collection.
    • Added AMD64 and ARM64 installation support across supported platforms.
    • Added SHA-256 verification and configuration validation during installation and setup.
    • Added lifecycle commands for installation, setup, start, stop, restart, status, logs, and debugging.
    • Added OTLP/HTTP export with resource metadata, batching, API authentication, and optional tenant support.
    • Improved platform detection, endpoint validation, status reporting, and help guidance.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a76f88c0-662b-432f-b9cf-515152f5adef

📥 Commits

Reviewing files that changed from the base of the PR and between 70e4e62 and 004f875.

📒 Files selected for processing (2)
  • scripts/ingest.ps1
  • scripts/ingest.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/ingest.ps1

Walkthrough

Both ingestion scripts replace Fluent Bit with the OpenTelemetry Collector. They add pinned, checksum-verified installation, Collector lifecycle management, host-metrics YAML generation, OTLP/HTTP JSON export, configuration validation, and updated command dispatch.

Changes

OpenTelemetry Collector ingestion

Layer / File(s) Summary
Collector installation and platform handling
scripts/ingest.ps1, scripts/ingest.sh
The scripts define Collector paths, select supported platforms, download pinned artifacts, verify checksums, extract binaries, and install them.
Collector process lifecycle
scripts/ingest.ps1, scripts/ingest.sh
Process detection, start, stop, restart, status, PID handling, configuration validation, and log output now target the OpenTelemetry Collector.
Host-metrics configuration flow
scripts/ingest.ps1, scripts/ingest.sh
Setup parses ingestion endpoints and generates validated YAML for host metrics, resource enrichment, batching, OTLP/HTTP JSON export, Parseable headers, authentication, and optional tenant metadata.
Command wiring and operator output
scripts/ingest.ps1, scripts/ingest.sh
Management, setup, and debug commands now invoke Collector functions. Help and completion messages use Collector terminology.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SetupScript
  participant OpenTelemetryCollector
  participant Parseable
  SetupScript->>SetupScript: parse endpoint and generate host-metrics YAML
  SetupScript->>OpenTelemetryCollector: validate and start configuration
  OpenTelemetryCollector->>Parseable: export metrics through OTLP/HTTP JSON
Loading

Suggested reviewers: pratik50

Poem

A rabbit checks the YAML flow,
As host metrics start to grow.
Checksums guard the collector’s track,
Logs record each start and back.
Parseable receives the stream,
OTel carries every gleam.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required description, rationale, key changes, and testing checklist are missing. Add a description that explains the goal, chosen solution, key changes, issue reference if applicable, and completed testing, comments, and documentation checklist items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing Fluent Bit with the OpenTelemetry Collector in ingestion scripts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
scripts/ingest.sh (2)

189-189: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add timeout and retry options to the download.

curl -fsSL has no time limit. If the connection stalls, the setup command hangs with no output. Add bounded retries and a maximum time.

♻️ Proposed refactor
-    curl -fsSL "$download_url" -o "$archive_path"
+    if ! curl -fsSL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 300 \
+        "$download_url" -o "$archive_path"; then
+        print_error "Failed to download OpenTelemetry Collector from $download_url"
+        rm -rf "$temp_dir"
+        exit 1
+    fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ingest.sh` at line 189, Update the curl download in the ingest script
to enforce a maximum request time and bounded retries, while preserving the
existing fail-silently and redirect-following behavior of curl -fsSL.

63-76: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Derive the process match from $CONFIG_FILE.

The case pattern hardcodes otelcol.yaml. If CONFIG_FILE changes, is_running returns false for a live collector, and start_collector launches a second process against the same PID file. Build the pattern from the variable.

♻️ Proposed refactor
 is_running() {
     local process_command
+    local config_base
+    config_base=$(basename "$CONFIG_FILE")
 
     if [ -f "$PID_FILE" ]; then
         PID=$(cat "$PID_FILE")
         if [[ "$PID" =~ ^[0-9]+$ ]] && ps -p "$PID" > /dev/null 2>&1; then
             process_command=$(ps -p "$PID" -o command= 2>/dev/null || true)
             case "$process_command" in
-                *otelcol*otelcol.yaml*) return 0 ;;
+                *otelcol*"$config_base"*) return 0 ;;
             esac
         fi
     fi
     return 1
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ingest.sh` around lines 63 - 76, Update is_running to derive the
process_command case pattern from CONFIG_FILE instead of hardcoding
otelcol.yaml. Ensure the pattern matches the collector command using the
configured file path or filename so live processes remain detected when
CONFIG_FILE changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ingest.ps1`:
- Around line 370-402: Align the generated YAML in the PowerShell configuration
block with scripts/ingest.sh by using the same collection interval and scraper
set, including the processes scraper. Update the OTLP exporter settings to use
the selected longer interval and enable gzip compression instead of uncompressed
JSON, while preserving the existing endpoint and headers.
- Around line 84-95: Update Get-Architecture to read PROCESSOR_ARCHITEW6432
first and use it when present, falling back to PROCESSOR_ARCHITECTURE otherwise.
Preserve the existing AMD64 and ARM64 returns and unsupported-architecture error
handling.
- Around line 422-424: After writing $CONFIG_FILE in the
configuration-generation flow, restrict its permissions to the current owner
only, equivalent to ingest.sh’s chmod 600. Use the existing PowerShell file path
and ACL APIs to remove inherited permissions and grant read/write access solely
to the owner, while preserving the UTF-8 no-BOM write behavior.

In `@scripts/ingest.sh`:
- Line 347: Update the configuration-file creation flow around CONFIG_FILE so
the file is created with mode 600 before the here-document writes the API key.
Apply the permission change before the cat redirection, and retain the existing
final permission handling as needed.

---

Nitpick comments:
In `@scripts/ingest.sh`:
- Line 189: Update the curl download in the ingest script to enforce a maximum
request time and bounded retries, while preserving the existing fail-silently
and redirect-following behavior of curl -fsSL.
- Around line 63-76: Update is_running to derive the process_command case
pattern from CONFIG_FILE instead of hardcoding otelcol.yaml. Ensure the pattern
matches the collector command using the configured file path or filename so live
processes remain detected when CONFIG_FILE changes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fbf0b932-e763-44d9-9ccb-ec5c3adf1bb8

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe859f and b350a89.

📒 Files selected for processing (2)
  • scripts/ingest.ps1
  • scripts/ingest.sh

Comment thread scripts/ingest.ps1
Comment thread scripts/ingest.ps1
Comment thread scripts/ingest.ps1 Outdated
Comment thread scripts/ingest.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
scripts/ingest.sh (2)

198-228: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Clean up installer temporary files on every failure path.

The script uses set -e. If extraction or replacement fails, execution exits before the final rm -rf "$temp_dir". Repeated failed installations can leave archives, extracted binaries, and $COLLECTOR_BIN.new in temporary storage. Add a cleanup trap after creating temp_dir, and clear it only after a successful replacement. (raw.githubusercontent.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ingest.sh` around lines 198 - 228, Add a cleanup trap immediately
after creating temp_dir so every subsequent failure removes the temporary
directory and any COLLECTOR_BIN.new replacement file. Clear the trap only after
the archive is successfully replaced, preserving cleanup for extraction, copy,
chmod, and mv failures in the installer flow.

Source: MCP tools


312-317: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle bracketed IPv6 hosts before generic colon parsing.

For https://[::1], the current branch treats the final colon as a port separator. It produces an invalid host and port instead of using the default port. Parse bracketed IPv6 separately, or reject IPv6 explicitly in the documented input format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ingest.sh` around lines 312 - 317, Update the host/port parsing logic
around ingestor_host so bracketed IPv6 values such as [::1] are handled before
the generic colon check, preserving the bracketed host and assigning
default_port when no port is provided. Keep explicit host:port parsing for
supported non-bracketed inputs unchanged, or reject IPv6 clearly if the
documented format does not support it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ingest.sh`:
- Around line 355-357: Update the configuration-writing flow in the ingest
script to write the generated content to a mode-600 temporary file instead of
truncating CONFIG_FILE. Validate the temporary file, and only after successful
validation atomically rename it over CONFIG_FILE; preserve the existing
CONFIG_FILE unchanged when writing, validation, or interruption fails, including
the corresponding flow around the additional CONFIG_FILE write.

---

Outside diff comments:
In `@scripts/ingest.sh`:
- Around line 198-228: Add a cleanup trap immediately after creating temp_dir so
every subsequent failure removes the temporary directory and any
COLLECTOR_BIN.new replacement file. Clear the trap only after the archive is
successfully replaced, preserving cleanup for extraction, copy, chmod, and mv
failures in the installer flow.
- Around line 312-317: Update the host/port parsing logic around ingestor_host
so bracketed IPv6 values such as [::1] are handled before the generic colon
check, preserving the bracketed host and assigning default_port when no port is
provided. Keep explicit host:port parsing for supported non-bracketed inputs
unchanged, or reject IPv6 clearly if the documented format does not support it.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e5565716-d648-4824-a26f-10116948b79e

📥 Commits

Reviewing files that changed from the base of the PR and between b350a89 and 70e4e62.

📒 Files selected for processing (2)
  • scripts/ingest.ps1
  • scripts/ingest.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/ingest.ps1

Comment thread scripts/ingest.sh Outdated
@nikhilsinhaparseable
nikhilsinhaparseable merged commit e32c0e9 into parseablehq:main Aug 9, 2026
12 checks passed
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.

2 participants