fix: parse cron observability events (#440) - #458
Open
agent-think[bot] wants to merge 1 commit into
Open
Conversation
Collaborator
|
@agent-think did you check the open api spec |
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.
Requested by @mattzcarey
Closes #440
What was wrong
apps/workers-observability/src/types/workers-logs.types.tsrequired$workers.outcomefor every telemetry event. The Workers Observability API legitimately omits that field (as well as the already-optional timing fields) foreventType: "cron", so the V4 response parser rejected the entire events response beforequery_worker_observabilitycould return it.There was no existing PR for #440, and
mainstill contained the required field when this change was prepared.What changed
$workers.outcomeoptional, matching the upstream event shape while preserving validation when it is presentcronrather thanscheduledas an example$metadata.originvalueworkers-observabilityTesting
expected string, received undefinederror at$workers.outcome.pnpm exec prettier --check apps/workers-observability/src/types/workers-logs.types.ts apps/workers-observability/src/workers-logs.types.spec.ts .changeset/fuzzy-jobs-observe.md— passedpnpm --filter workers-observability check:lint— passedpnpm --filter workers-observability check:types— passedpnpm --filter workers-observability test— passed (2 files, 9 tests)pnpm exec changeset status— passedDemo
Demo URL (expires after 60 mins): https://issue-440-cron-observability-demo.palm-pepperberry.workers.dev
Open the page and press Parse cron event; it displays PASS and the parsed cron event even though
outcome,cpuTimeMs, andwallTimeMsare absent. The demo runs the packedworkers-observabilityschema from this branch (plus its packed workspace dependency).🤖 generated by the pr-agent — please review carefully