Repository navigation
Wire pegma-dev-api logging (Cloudflare + Datadog tee) - #3
Conversation
Add a thin Workers composition root that tees Cloudflare Workers Logs and Datadog through @pegma/logger-*, enable the Cloudflare log store via wrangler observability, and deploy on main. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Cloudflare Worker (pegma-dev-api) as a thin API slice focused on validating Pegma’s dual-sink logging composition (Cloudflare Workers Logs + optional Datadog), and wires deployment via Wrangler and the existing deploy workflow.
Changes:
- Add
worker/with a/healthendpoint and a composed Spine logger (createTeeLogger(cloudflare, datadog)), with Datadog shipping enabled only whenDATADOG_API_KEYis set. - Enable Workers Logs persistence via Wrangler
observability.logsand add local/dev ergonomics (scripts,.dev.varsexample, gitignore). - Deploy the Worker from GitHub Actions after Pages deploy, and document the new Worker/logging slice in repo docs.
Reviewed changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| worker/wrangler.jsonc | Defines the Worker entrypoint and enables Workers Observability + persistent logs store. |
| worker/src/logger.ts | Composition root for tee logging and Datadog intake shipping helper. |
| worker/src/index.ts | Worker handler with request logging and ///health endpoint. |
| worker/README.md | Documents Worker purpose, log store enablement, and Datadog secret setup. |
| worker/.dev.vars.example | Example local env vars for wrangler dev. |
| tsconfig.json | Includes Worker sources in TS project and adds Workers ambient types. |
| README.md | Updates repo overview to include the Worker logging slice and basic commands. |
| package.json | Adds Wrangler scripts and Pegma logger dependencies + toolchain devDependencies. |
| package-lock.json | Locks newly added dependencies/tooling versions. |
| docs/PROJECT_PLAN.md | Records the logging precursor milestone for Phase 4 gating context. |
| AGENTS.md | Updates agent guidance to explicitly allow a thin logging Worker pre-Phase 4. |
| .gitignore | Ignores Wrangler state directory and local Worker dev vars file. |
| .github/workflows/deploy.yml | Adds a Worker deploy step on main (after Pages deploy). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd4c81115d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The org is on us5; shipping to the us1 host silently dropped Worker logs. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Worker redeploys aligned with Pages on schedule/dispatch; prevent attribute override of service identity; normalize DATADOG_SITE; document Workers:Edit on the shared CI token. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
pegma-dev-apiwithcreateTeeLogger(cloudflare, datadog)composition rootobservability.logs(persist: true)DATADOG_API_KEYsecret is setTest plan
npx wrangler deploy -c worker/wrangler.jsoncsucceededGET https://pegma-dev-api.websitemakers-et-al.workers.dev/healthreturnscloudflare: truenpm run worker:tail)wrangler secret put DATADOG_API_KEY -c worker/wrangler.jsoncand verify Datadog intake