Repository navigation
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 selected for processing (1)
💤 Files with no reviewable changes (1)
📝 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 Mergeability Score: ⚪ Minimal · up to This change removes unused New Relic instrumentation and related configuration while preserving existing query latency metrics; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ❌ 2❌ Failed checks (2 warnings)
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 31674162950Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.06%) to 48.266%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions31 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
rohilsurana
left a comment
There was a problem hiding this comment.
Clean removal of the unused New Relic instrumentation. Verified go build, go mod tidy (no changes), and config-loader compatibility. Also dropped the stale newrelic TODO comment in organization_repository.go. LGTM.
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