You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(observability): instrument webhook handlers and evaluation phases
Adds OpenTelemetry spans around every webhook handler and around each
phase of EvalContext (parse_config, evaluate_policy, post_status,
post_evaluate_actions, evaluate_pr per child PR). Spans carry typed
attributes so dashboards and Jaeger queries can filter by:
github.event.type / github.event.action / github.delivery_id
github.installation_id / github.sender.login
github.repo.owner / github.repo.name / github.repo.full_name
github.pr.number / github.sha
github.review.state / github.review.author
github.check_run.name / github.check_run.conclusion
policy.status / policy.trigger / policy.skip_reason
policy.skip_reason values come from a stable enum (SkipReasonNoPolicy,
SkipReasonSelfSender, SkipReasonReviewDoesNotAffectApproval, ...) so
alerts and dashboards can pin to specific filter strings.
Errors are propagated to the span via SetStatus(Error)+RecordError so
Jaeger highlights failed spans. Named-return + 'defer RecordError(span,
&err)' is the per-handler idiom.
Webhook spans use SpanKind=Consumer to match the async dispatch model.
The handler logic runs in worker goroutines (QueueAsyncScheduler), so
the inbound HTTP server span ends quickly while these spans live on
under the same trace context (propagated via context.WithoutCancel).
* feat(observability): template outbound GitHub API paths in span names
Replace per-request span names like 'GitHub API: GET
/repos/{owner}/{repo}/pulls/12345/files' (where each PR number, SHA,
or installation ID produces a unique operation name) with templated
forms like 'GitHub API: GET /repos/{owner}/{repo}/pulls/{pull_number}/files'.
Without this, every distinct path fans out to its own operation in
Jaeger and defeats aggregation in dashboards.
The templater walks path segments contextually: numeric IDs after
pulls/issues/check-runs/comments/reviews/etc. become {pull_number},
{issue_number}, ...; hex SHAs after commits/statuses/trees/blobs
become {sha}; refs/heads/{ref} collapses everything after to {ref}
(branches can contain slashes); contents/{+path} similarly eats the
tail.
Owner and repo become {owner}/{repo} placeholders in the operation
name; they appear as attributes on the bot's own spans for per-repo
filtering.
Covered by otel_test.go with edge cases (numeric IDs vs hex SHAs,
branches with slashes, top-level paths, empty path).
0 commit comments