Skip to content

[HDX-4329] replace collector tailer with the supervisors' native log redirection - #2800

Open
tommyzli wants to merge 1 commit into
hyperdxio:mainfrom
tommyzli:collector-log-redirect
Open

[HDX-4329] replace collector tailer with the supervisors' native log redirection#2800
tommyzli wants to merge 1 commit into
hyperdxio:mainfrom
tommyzli:collector-log-redirect

Conversation

@tommyzli

@tommyzli tommyzli commented Aug 4, 2026

Copy link
Copy Markdown

Summary

The log tailer is mangling log lines because there is no synchronization in how it can join the collector's stdout with the supervisor. The opampsupervisor has a native feature for log redirection, where it scans the collector's stdout line by line and re-emits it in the supervisors logger: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/opampsupervisor/supervisor/commander/commander.go#L181-L191
This avoids the mangling problem, but emits weird log lines where the full body of the collector log is nested in the supervisors log. I think it's worth it.

Screenshots or video

Before After

How to test on Vercel preview

Preview routes:

Steps:

References

  • Linear Issue: HDX-4329
  • Related PRs:

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

@tommyzli is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the collector log FIFO/tailer with the OpAMP supervisor’s native conditional log passthrough and directs collector telemetry logs to stdout to avoid incorrect outer severity classification.

  • Removes the tailer script, image copy, background process, and FIFO setup.
  • Enables agent.passthrough_logs when OTEL_SUPERVISOR_LOGS=true.
  • Adds a patch changeset documenting the corrected log-forwarding behavior.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code regression identified.

The new native passthrough is activated under the same environment condition as the removed tailer, and the associated stdout configuration, image packaging, and startup changes remain consistent across the affected deployment paths.

Important Files Changed

Filename Overview
docker/otel-collector/entrypoint.sh Removes the background tailer and FIFO setup while retaining the same environment-controlled activation model through the rendered supervisor configuration.
docker/otel-collector/supervisor_docker.yaml.tmpl Conditionally enables the supervisor’s native collector-log passthrough for the existing exact "true" environment setting.
docker/otel-collector/config.yaml Routes collector telemetry logs to stdout so passthrough does not classify every wrapped collector record as an outer error.
docker/otel-collector/Dockerfile Stops packaging the deleted tailer script because collector output is now handled by the supervisor.
docker/otel-collector/log-tailer.sh Deletes the polling tail process whose concurrent writes could interleave with supervisor output.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Collector[OTel Collector] -->|stdout / stderr| Supervisor[OpAMP Supervisor]
  Flag{OTEL_SUPERVISOR_LOGS = true?}
  Flag -->|yes| Passthrough[Native passthrough_logs]
  Flag -->|no| Default[Default supervisor handling]
  Passthrough --> Logger[Supervisor logger]
  Logger --> Container[Container logs]
Loading

Reviews (1): Last reviewed commit: "replace collector tailer with the superv..." | Re-trigger Greptile

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