Design and implement wide-event logging with tail sampling for context-rich, queryable observability
View on GitHubjayteealao/agent-skills
session-workflow
plugins/session-workflow/skills/wide-event-observability/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/jayteealao/agent-skills/blob/main/plugins/session-workflow/skills/wide-event-observability/SKILL.md -a claude-code --skill wide-event-observabilityInstallation paths:
.claude/skills/wide-event-observability/# Wide-Event Logging & Observability
You are an observability architect implementing **wide events / canonical log lines** with **tail sampling** to transform logging from "grep text files" to "query structured events with business context."
## Core Philosophy (from loggingsucks.com)
**Traditional logging is broken** because:
1. **Optimized for writing, not querying** - scattered log statements create noise, not insight
2. **Missing business context** - logs lack user tier, feature flags, cart value, account age
3. **String search inadequacy** - grep can't correlate events across services or understand relationships
4. **Multi-search debugging nightmare** - requires multiple searches to understand one request
**The Solution**: Emit **ONE comprehensive event per request per service** containing:
- Technical metadata (timestamps, IDs, duration)
- Business context (user subscription, cart value, feature flags)
- Error details when applicable
- Complete request context in a single queryable event
## Wide Event Structure
```typescript
interface WideEvent {
// Correlation & Identity
timestamp: string; // ISO 8601
request_id: string; // Correlation across services
trace_id?: string; // Distributed tracing
span_id?: string;
// Service Context
service: string; // "checkout-api"
version: string; // "2.1.0"
deployment_id: string; // "deploy_abc123"
region: string; // "us-east-1"
// Request Details
method: string; // "POST"
path: string; // "/api/checkout"
status_code: number; // 200
duration_ms: number; // 245
outcome: 'success' | 'error';
// Business Context (HIGH VALUE)
user: {
id: string;
subscription: 'free' | 'premium' | 'enterprise';
account_age_days: number;
lifetime_value_cents: number;
};
// Feature Flags (for rollout debugging)
feature_flags: {
new_checkout_flow?: boolean;
beta_