Skip to content

feat(webapp): trace deployment outcomes and compute template creation#4015

Merged
nicktrn merged 3 commits into
mainfrom
feat/compute-template-creation-span
Jun 22, 2026
Merged

feat(webapp): trace deployment outcomes and compute template creation#4015
nicktrn merged 3 commits into
mainfrom
feat/compute-template-creation-span

Conversation

@nicktrn

@nicktrn nicktrn commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Deploy success/failure wasn't easily observable: compute template creation only logged, and the terminal deployment statuses (deployed / failed / timed-out) weren't traced — so deploy health couldn't be seen without querying the database.

This adds two spans:

  • compute.template.create around template creation at finalize, tagging the resolved mode and per-preset outcome. resolveMode now returns its decision (mode + reason) so the span can record why a mode was chosen.
  • deployment.outcome via a small shared helper (recordDeploymentOutcome) emitted at every terminal-status write — finalize (deployed), fail / index-failed / background-worker (failed), and timeout (timed out) — so deploy success/failure is queryable by status and reason.

The helper is best-effort (org/project/env enrichment where cheaply available) and never throws, so telemetry can't break a deploy.

@nicktrn nicktrn self-assigned this Jun 22, 2026
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 58b0f61

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 56d4cc1d-8fe4-4205-b81e-fbc67cc6580f

📥 Commits

Reviewing files that changed from the base of the PR and between ff69578 and 58b0f61.

📒 Files selected for processing (2)
  • apps/webapp/app/v3/services/createDeploymentBackgroundWorkerV4.server.ts
  • apps/webapp/app/v3/services/recordDeploymentOutcome.server.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/webapp/app/v3/services/recordDeploymentOutcome.server.ts
  • apps/webapp/app/v3/services/createDeploymentBackgroundWorkerV4.server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: typecheck / typecheck

Walkthrough

Two separate observability improvements are added. First, a new recordDeploymentOutcome helper emits a deployment.outcome OpenTelemetry span for terminal deployment states (FAILED, DEPLOYED, TIMED_OUT), setting error status and a reason for non-success outcomes. This helper is wired into five existing services: FailDeploymentService, FinalizeDeploymentService, DeploymentIndexFailed, TimeoutDeploymentService, and CreateDeploymentBackgroundWorkerServiceV4. The background worker service is also enhanced to accept environment in its failure handler and record deployment outcomes after failed transitions. Second, ComputeTemplateCreationService replaces its bare TemplateCreationMode string return from resolveMode with a structured ResolvedTemplateMode object carrying mode, migrated, and reason fields, and wraps handleDeployTemplate in a compute.template.create span that records these fields along with preset counts and the final result.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is comprehensive but does not follow the provided template structure with required sections like Closes #, Checklist, Testing, and Changelog. Add the missing template sections: issue reference, checklist with contributing guide/PR title/testing confirmation, Testing section describing test steps, Changelog with short summary, and Screenshots if applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main changes: adding tracing for deployment outcomes and compute template creation, which aligns with the core purpose of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/compute-template-creation-span

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nicktrn nicktrn force-pushed the feat/compute-template-creation-span branch from dc84dc5 to ff69578 Compare June 22, 2026 16:13
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread apps/webapp/app/v3/services/timeoutDeployment.server.ts
@nicktrn nicktrn merged commit bf4c6e9 into main Jun 22, 2026
36 checks passed
@nicktrn nicktrn deleted the feat/compute-template-creation-span branch June 22, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants