Add project setup diagnostics and verification flow - #31
Merged
Merged
Conversation
bashgeek
force-pushed
the
feat/project-setup-diagnostics
branch
from
September 9, 2026 23:37
ce6cc72 to
c9b4b39
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Add setup checks, receipts, and observations to track when events, transactions, and profiles first arrive for a project - Record per-envelope-item outcomes (queued/rejected) with reasons for setup diagnostics - Add sourcemap verification endpoint to confirm source maps resolve real stack frames - Support looking up an exact event by id for global latest-event and issue-trace endpoints - Add ProjectSetup UI components and ProjectSetupView with e2e coverage - Add migration 0021 for project setup tables
bashgeek
force-pushed
the
feat/project-setup-diagnostics
branch
from
September 10, 2026 01:08
c9b4b39 to
f7ae977
Compare
- Add a query tracer to count INSERT calls against project_setup_observations - Verify recordSetupWriteFailure writes exactly one observation per distinct project ID in a batch, even with duplicates - Assert rejected/storage_failed observations are recorded and no setup receipts are created on failure
- Cover source map verification failing on a database error instead of claiming a missing map - Cover exact event lookup for an issue, including cross-issue scoping and cancellation - Cover setup check project scoping and setup receipts surviving event retention deletes - Cover ProjectSetup UI handling of transaction/profile linking, stale saved checks, processing events, and unavailable source map storage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a per-project "setup status" flow that tells users whether their SDK is sending events, transactions, and profiles correctly, and lets them verify source map resolution against a real event. This replaces the old global
/metricsand/api/instance/ingestionendpoints, which only exposed aggregate buffer stats and offered no way to tell whether a specific project's integration actually works.Closes #
Type of change
Changes
project_setup_checks,project_setup_receipts, andproject_setup_observationstables (migrations/0021_project_setup.up.sql) to track setup checks, first/last received event kinds, and ingest rejection reasons per project.internal/storage/setup.gowith helpers to start a setup check, record/list receipts, and record/list observations.internal/api/setup.gowith new endpoints:GET /api/setup-status— setup completion summary across projects.GET /api/projects/{slug}/setup-status— receipts, observations, an in-flight check, recent examples (event/transaction/profile), and source map availability for a project.POST /api/projects/{slug}/setup-checks— start a new setup check.GET /api/projects/{slug}/setup-sourcemaps— verify source map resolution against a chosen event.handleEnvelope(internal/api/ingest.go) to record a bounded per-kind/outcome observation (queued/rejected + reason) on every ingest, replacing ad hoc buffer drop-reason counters.internal/sourcemaps/verify.goto resolve and validate stack frames against uploaded source maps for a given event.internal/api/ingestion_health.go(/metricsPrometheus endpoint and/api/instance/ingestionJSON stats) and its tests, along with the now-unused ingest queue/drop-reason plumbing (internal/ingest/queue.go,writer_test.go, related buffer stats).internal/ingest/buffer.go,logbuffer.go,profilebuffer.go,txbuffer.go, and addinternal/ingest/setup.goto support the simplified accounting used by the new observations.cmd/tindra/main.go: buffers now share the server's root context instead of a separatewriterCtx, removing a redundant cancel/drain path.event_idquery support toGetLatestEventGlobal/GetIssueTrace(internal/api/global.go,internal/storage/events.go) so setup diagnostics can fetch a specific example event.web/src/components/ProjectSetup.vueandweb/src/views/ProjectSetupView.vueplusweb/src/api/setup.tsto surface setup status, live-checking, and source map verification in the UI; wire intoweb/src/router/index.tsandweb/src/stores/projects.ts.web/e2e/navigation.test.tsandweb/src/views/__tests__/QueryStates.test.tsin favor ofweb/e2e/setup.test.tsand updated per-view tests.STATS_API_KEY-gated/metricsreferences from.env.example,docker-compose.yml, andinstall.sh, and remove the now-unneededstop_grace_period(shutdown no longer needs the extra drain time).Test plan
internal/api/setup_test.go,setup_ingest_internal_test.go,setup_failures_internal_test.gocover setup-status/check/sourcemap endpoints, envelope rejection reasons, and partial-database-failure handling.internal/storage/setup_test.goandinternal/ingest/setup_internal_test.gocover the new storage and ingest helpers.internal/sourcemaps/verify_test.go/verify_internal_test.gocover source map verification, including malformed maps and unresolved frames.web/src/components/__tests__/ProjectSetup.test.tsandweb/src/views/__tests__/ProjectSetupView.test.tscover the new UI flow;web/e2e/setup.test.tscovers the end-to-end setup journey.go test ./...and the web test suite pass locally.Checklist
Contributor License Agreement