refactor: remove unused new relic instrumentation - #1876
Conversation
The agent was never initialized: nothing reads the new_relic config and no code starts a New Relic transaction, so the datastore segments never ran. Query latency is already covered by the Prometheus histograms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
💤 Files with no reviewable changes (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change removes New Relic configuration, the Go dependency, and datastore instrumentation from SpiceDB relation operations and database timeout handling. Existing SpiceDB operations, Prometheus metrics, and timeout behavior remain. ChangesNew Relic removal
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 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 |
Coverage Report for CI Build 31597245221Coverage increased (+0.06%) to 48.263%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Summary
Removes the New Relic go-agent v2 dependency and all its call sites. This was dead code: the agent was never initialized — nothing reads the
new_relicconfig and nothing starts a New Relic transaction — sonewrelic.FromContextalways returned nil and the segment blocks never ran. Query latency is already recorded by the Prometheus histograms in the same code paths.Tracing will be added with OpenTelemetry instead; it is not wired up yet and is tracked separately in #1875.
Closes #1783. Part of #1782.
Changes
pkg/db/db.go: drop the datastore segment inWithTimeoutinternal/store/spicedb/relation_repository.go: drop the segments inAdd,Check, andDeleteconfig/config.go: drop the unusednew_relicconfig blockconfig/sample.config.yaml: drop the sample entrygo.mod/go.sum: dropgithub.com/newrelic/go-agentTechnical Details
Config files that still contain a
new_relic:block keep loading; the loader ignores unknown keys.Test Plan
go build ./...,golangci-lint runon the touched packages, andgo test ./pkg/db/... ./config/...pass. Verified a config file containing the oldnew_relic:block still loads.SQL Safety (if your PR touches
*_repository.goorgoqu.*)?placeholders,goqu.Ex{}, orgoqu.Record{}— neverfmt.Sprintfor+building a query that gets executed.🤖 Generated with Claude Code