feat: Add Cloudflare Workers observability and logging#9
Merged
Conversation
- Enable Workers Logs in wrangler.toml with full sampling - Add Analytics Engine integration for metrics collection - Create observability utility module with structured logging - Enhance logger middleware with W3C Trace Context support - Add GitHub API monitoring with rate limit tracking - Update Monitor class with Analytics Engine integration - Add trace headers (X-Trace-Id, X-Span-Id, X-Ray-Id) to responses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
devcard_metricsdataset) for metrics collectionobservability.tsutility with structured logging and W3C Trace Context supportChanges
wrangler.toml
[observability]section with logs enabled[[analytics_engine_datasets]]for metrics storageLOG_LEVELenvironment variablenodejs_compatcompatibility flagNew File:
src/utils/observability.tsLoggerclass with structured JSON logging (debug/info/warn/error levels)Observabilityclass for Analytics Engine integrationEnhanced:
src/middleware/logger.tstraceparentheader parsing)X-Trace-Id,X-Span-Id,X-Ray-IdEnhanced:
src/fetchers/github.tsTest plan
pnpm typecheck- passespnpm build- passesnpx wrangler deploy --dry-run- shows correct bindings🤖 Generated with Claude Code