openwrt / openwrt/openwrt-bot-worker

Structured logging with the X-GitHub-Delivery correlation id

Open
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
1d 19h
Merged PRs (30d)
3

Description

Two independent reviews landed on the same gap: logging is bare console.log/warn/error with ad-hoc prefixes ([Stale Bot], GitHub API call failed...), and the correlation id GitHub hands us for free — the X-GitHub-Delivery header — is never read.

Proposal: one log(level, event, fields) helper emitting a single JSON object per line, which Cloudflare indexes:

{ "level": "warn", "event": "github_api_retry", "delivery": "8ad0...",
  "repo": "openwrt/packages", "pr": 1234, "installation": 456,
  "method": "GET", "endpoint": "/repos/.../commits", "status": 503,
  "attempt": 2, "budget_used": 31, "deploy": "d8f0c4e" }

Worth carrying on every line: delivery id, event/action, repo, PR or issue number, installation id, head SHA, and for API calls the operation, attempt, status and remaining budget. That turns "why did this PR behave oddly" into one filter on delivery=... covering the whole lifecycle — token, config, commits, validators, labels, comment, check-runs.

Not urgent, but it is the difference between reading logs and grepping them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing console.log/warn/error calls and the request-handling path where X-GitHub-Delivery is available. Trace the token, config, commits, validators, labels, comment, and check-runs lifecycle to define the fields each event needs. Done means one JSON object per line with the requested correlation and operation fields, indexed by delivery id.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.