Send only error spans to Honeycomb behind a toggle and stop deploying Refinery - #2923
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change removes Refinery CI deployment and endpoint configuration. It adds a toggle-controlled Honeycomb exporter that can forward all spans or only error spans, with tests for both modes. ChangesRefinery removal
Configurable Honeycomb tracing
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant BatchSpanProcessor
participant HoneycombExporter
participant OTLPExporter
BatchSpanProcessor->>HoneycombExporter: export span batch
HoneycombExporter->>HoneycombExporter: check honeycomb-error-spans-only?
HoneycombExporter->>OTLPExporter: export selected spans
OTLPExporter-->>BatchSpanProcessor: return export result
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The configurable Honeycomb export behavior has no identified merge-blocking issue. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
Prod sends every span to a Refinery box (45 to 90 GB a day), which keeps traces with an error plus a small sample and forwards about 0.5 GB a day to Honeycomb. We mostly use Honeycomb for error alerts now. Everything else we read from the span logs that vector ships to S3. The box, its load balancer and the traffic cost about $79 a month.
This lets prod send spans to Honeycomb directly and only send the ones with an error status:
honeycomb-error-spans-only?toggle, off by default.make-honeycomb-exporterwraps the OTLP exporter, and when the toggle is on it drops every span whose status is notERROR. That is the statusadd-exception!sets, so silenced exceptions are not sent. With the toggle off every span is exported as before, so self-hosted setups with a Honeycomb key see no change.docker-compose.ymlno longer setsHONEYCOMB_ENDPOINT, so the server uses the defaulthttps://api.honeycomb.io:443. Refinery forwarded spans with the key the server already sends inx-honeycomb-team, so the same key works.publish-refinery-ebjob and its change detection are removed.server/refinerystays in the repo for anyone who wants to run it.The logging exporter is untouched. All spans still go to stdout and S3.
Startup: the toggle is read on every export batch, not when the tracer is built, because
tracer/initruns before flags load. Before flags load it readsfalse.flags-impl/initfetches flags in the foreground before the HTTP server starts, so the only unfiltered spans are the few from the invalidator and WAL starting up.instant.flagsdoes not depend on the tracer, and the tracer already required it.From a sample of Sep 16 logs, error spans are about 47 a second (4.1 M a day). Honeycomb already receives these today through Refinery's keep-errors rule. 88% of them are
permission-evaluation-failedon transacts, which shows up twice: once onpermissioned-transaction/transact!and once onuncaught-exception.What changes in Honeycomb with the toggle on: error events arrive as single spans instead of whole traces, and the sampled non-error traffic stops. The e2e invalidator tracking spans are no longer sent there, they are still in the logs.
Rollout:
togglesentity withsetting=honeycomb-error-spans-only?andtoggled=true. Do this before deploying. Without it prod would send every span (about 1,200 a second) straight to Honeycomb.eb-refinery-elbdrops to zero.refineryElastic Beanstalk environment.Release bundles built from older commits still point at Refinery. After step 4 a deploy of one of those would log export failures and send nothing to Honeycomb. Nothing else breaks.
The test covers an ok span, an error span and a silenced exception, with the toggle off and on.
🤖 Generated with Claude Code