feat: implement wide events with span attributes for observability#195
Merged
feat: implement wide events with span attributes for observability#195
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- Add advice strings to humane.Wrap/humane.New calls for better error messages - Add context to bare error returns with fmt.Errorf wrapping - Add nolint comments for intentional panic() in flag binding code - Replace panic with log.Error in o11y shutdown cleanup - Add fmt import where needed for error wrapping Reduces linter violations from 514 to 422 (18% improvement)
- Add more advice strings to humane.Wrap/humane.New calls - Fix operator.go, serve.go, and related files Further reduces linter violations.
- Add actionable advice to spinner/async operation errors - Add advice to kubeconfig serialization errors - Add advice to config file operations - Add advice to shell cleanup errors Further reduces linter violations from 366 to 351.
Member
Author
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Graphite Automations"Auto-assign PRs to author" took an action on this PR • (01/17/26)1 assignee was added to this PR based on Cedric Specht's automation. "Request reviewers once CI passes" took an action on this PR • (01/17/26)1 reviewer was added to this PR based on Cedric Specht's automation. |
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
This PR implements the wide events pattern across the codebase, replacing scattered log statements with single structured events that capture all relevant context. The wide event data is also added as span attributes for better tracing correlation.
Changes
KubeOperator.Reconcilenow emits a single event at the end with operation details, username, success status, duration, and trace contextreconcile.{name,namespace,username,operation,success,duration_ms}auth.{username,remote_addr,path,success,reject_reason,status_code}login.{username,role,period,status,valid_until}kubeconfig.{username,status,http_status,format}logout.{username,role,was_provisioned,status}shutdown.{health_ok,tailscale_ok}tailnet.{url,dns_name,port,protocol}span.RecordError()andspan.SetStatus(codes.Error, ...)NewErrorResponse, fixed symbol consistency in error renderingTest plan
Note
Introduces structured "wide events" and rich span attributes for end-to-end observability, replacing scattered logs and improving trace correlation.
authmiddleware rejections,KubeOperator.Reconcile, and server shutdown; record errors viaspan.RecordError/SetStatuslogin,logout,kubeconfig) to set attributes, return clearer errors, and includeRetry-After; preserve advice inmodels.ErrorResponsehttp.Clienttimeout; update commands to passcontextand improve user-facing error advice.arch-go.yaml,.golangci-tka.yaml,.golint-sl.yaml), Makefile tasks, and docs updatesWritten by Cursor Bugbot for commit 88bf15e. This will update automatically on new commits. Configure here.