trademachines/riemann-client-php
A PHP client for Riemann, the event stream processor for monitoring distributed systems. Send events, metrics, and state updates from your Laravel or PHP applications to a Riemann server with a simple, expressive API.
What the package is. trademachines/riemann-client-php is a thin PHP client for Riemann, a Clojure-based event stream processor used to aggregate, filter, and route monitoring events (typically to Graphite, InfluxDB, PagerDuty, Slack). The client's job is narrow: encode Event/Message structs as Protobuf, open a TCP socket to Riemann's default port 5555, and write them. There is no Laravel service provider, config, facade, or queue integration implied by the package name.
Adoption signals are effectively zero. Score 0, no stars recorded, zero dependents. This is not a "small but healthy" package — it is an unvetted third-party artifact with no observable downstream usage to learn from. Treat it as code you would be adopting and owning, not code you would be consuming.
Architecture fit. Riemann is a push-based, Protobuf-over-TCP system. That maps poorly onto typical Laravel request lifecycles unless deliberately wrapped:
| Concern | Fit | Notes |
|---|---|---|
| Emitting business/app events | Moderate | Natural if Riemann is already the estate's event bus |
| Request-path metrics (latency, counters) | Poor directly | Synchronous TCP write per event adds latency and a hard dependency on an external service |
| Queue-worker instrumentation | Moderate | Needs batching client-side; per-job socket writes will dominate short jobs |
| Replacing logs/Sentry/Prometheus | None | Riemann is a router/aggregator, not a full observability backend |
The package almost certainly predates Laravel's modern package conventions. Expect to write the service provider, config file, connection lifecycle, and reconnect logic yourself.
Integration feasibility. Two hard dependencies must be verified before any estimate is credible:
google/protobuf (Composer) and/or the protobuf C extension, plus message classes generated by an older protoc. Protobuf's PHP API changed across 3.x → 4.x; generated classes from a 2017-era protoc frequently fail to load on modern runtimes.Stringable/ReturnTypeWillChange issues are likely in transitive code.Technical risk register.
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Package abandoned / no security response | High | Medium | Vendor/fork it; pin commit SHA, not a version range |
| Protobuf version incompatibility | Medium-High | High (blocks install) | Spike first; consider hand-rolled encoder (the wire format is simple) |
| Riemann itself is low-activity upstream | High | High | Confirm the platform team still operates it before integrating |
| Synchronous write in request path | High | High | Wrap in buffered/async emitter; never call from controllers |
| Silent event loss on socket failure | High | Medium | Fail-open by design; metric on dropped events |
| Bus-factor on Clojure stream config | High | Medium | Require platform-team ownership of riemann.config |
Key questions for the vendor/platform team.
Verdict. Low strategic value, low technical readiness. Only pursue if Riemann is already a first-class part of the platform and the ask is "let PHP apps publish to it." Otherwise this is a solution looking for a problem, and StatsD/OpenTelemetry/Prometheus push would be a better-targeted investment.
Stack fit. The package assumes a plain PHP process with a persistent socket. Laravel's execution models each stress that assumption differently:
terminate(), or push to a queue.Recommended shape. Do not let application code touch the vendor client directly. Introduce a one-method internal contract:
MetricsEmitter::emit(string $service, array $attributes, float $value = 1.0)
Back it with two implementations: a null/no-op (default, for local and CI) and a Riemann adapter that wraps the package. This contains the adoption risk to a single class, makes the vendor package swappable for StatsD or OTLP later, and lets you defer the Riemann decision without blocking feature work.
Migration path. There is no migration — nothing to migrate from in this package. The sequencing is greenfield:
app/Support/Riemann or an internal Composer package under our VCS. Pinning to a GitHub SHA of an unmaintained repo is not a durable dependency.Compatibility checklist before sequencing.
google/protobuf major version resolved.riemann:5555.Sequencing note. Steps 1 and 2 are time-boxed and independently valuable — the spike result is a decision deliverable even if the answer is "no." Do not sequence application instrumentation work behind this; use the no-op emitter so product delivery is decoupled from the observability decision.
Maintenance. The realistic steady state is that we maintain this, indefinitely. No upstream security patches, no PHP 8.4/9 readiness, no Protobuf compatibility work. Budget a small but permanent tax: a few days per year for runtime upgrades, plus a fork to track. Weigh that against the ~2–3 days to hand-roll an equivalent encoder, which removes the Protobuf dependency entirely.
Support. No vendor, no SLA, no issue triage. Internal support means whoever forked it. Escalation path for "metrics stopped flowing" terminates at our own on-call, not a maintainer. Document the fork owner explicitly in the service catalog.
Scaling characteristics.
Failure modes to design for.
| Failure | Observed behavior | Required handling |
|---|---|---|
| Riemann down / unreachable | Connect timeout blocks the calling thread | Short connect timeout (≤100ms), fail-open, circuit breaker |
| Riemann restart | Stale socket, broken pipe on next write | Detect, reconnect, drop the in-flight batch |
| Slow Riemann / TCP backpressure | Write blocks, request latency climbs | Async flush via queue; bounded buffer with drop-oldest |
| Protobuf encode error | Exception in request path | Catch at adapter boundary; never propagate to user code |
| Event storm | Unbounded memory in buffer | Hard cap + sampled/dropped counters |
| Network partition | Silent loss | Expose a riemann_events_dropped_total counter and alert on it |
The non-negotiable design principle: emitting telemetry must never be able to fail a user request. Every failure mode above should degrade to a counter increment, not an exception.
Ramp-up. Two distinct skill gaps, neither small:
riemann.config, a Clojure DSL. That is a platform-team skill, not an application-team one. If no one on staff writes Clojure today, the package is the easy part and the streams config is the real cost.protoc and familiarity with the PHP runtime's quirks. Low frequency, high friction; a classic thing to get wrong during a PHP upgrade.Bottom line for operations. This package adds a hard, unsupported dependency to the request path in exchange for a capability most estates already get from StatsD, OpenTelemetry, or Prometheus pushgateway with far better tooling and hiring pools. Recommended posture: do not adopt unless Riemann is already an owned, operated platform component — and even then, fork it behind an internal interface with a no-op default, so the blast radius is one class and the exit is a config change.
How can I help you explore Laravel packages today?