Daniel Fridkin · Home
Back to projects

Observability / Legacy Modernization

Legacy PHP Modernization and Distributed Tracing

Brought modern distributed tracing and OpenTelemetry into a legacy PHP 5.6 application without rewriting it, using a lightweight shim and edge-level trace injection.

Production modernization

Tracing flow

Trace visibility without a full rewrite

The tracing integration connects edge injection, a lightweight legacy application shim, and trace/log correlation.

  1. Inject at the edge

    Use native OpenTelemetry injection in the proxy.

    • Traefik
    • OpenTelemetry
  2. Instrument the legacy app

    Introduce tracing with an auto_prepend_file shim.

    • PHP 5.6
  3. Correlate traces & logs

    Connect trace data and log-derived fields for investigation.

    • Tempo
    • Loki

The challenge

Legacy PHP systems need trace visibility and modernization paths without risky full rewrites.

The approach

Used an auto_prepend_file shim, Traefik native OpenTelemetry injection, Grafana Tempo, and Loki derived fields to correlate traces and logs while supporting route-by-route strangler migration into Kubernetes.

My role

Integrated tracing across legacy application code, edge routing, logs, and Kubernetes migration work.

Engineering decisions

Modernize incrementally

Add trace visibility through a small shim instead of making a full PHP rewrite a prerequisite.

Support route-by-route migration

Use trace/log correlation while the monolith moves toward Kubernetes through a strangler migration.

Scope & delivery

  • Distributed tracing for PHP 5.6 without a rewrite.
  • Traefik native OpenTelemetry injection at the edge.
  • Loki-to-Tempo trace correlation with derived fields.
  • Strangler-pattern migration support for a legacy monolith moving route by route into Kubernetes.
Next projectDatabase Operations and Monitoring