惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
WordPress大学
WordPress大学
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
罗磊的独立博客
The Cloudflare Blog
V
V2EX
月光博客
月光博客
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
博客园 - 【当耐特】
T
Tailwind CSS Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
gotracer: Turn Go Execution Traces into Actionable Findings
Haleh · 2026-05-29 · via DEV Community
Cover image for gotracer: Turn Go Execution Traces into Actionable Findings

Haleh

go tool trace provides a browser UI for exploring Go execution traces. It works well for manual
investigation, but it doesn't fit into scripts or CI pipelines — you can't grep the output, set
thresholds, or fail a build based on what the trace contains.


The problem

Go execution traces contain detailed runtime events: GC pauses, goroutine scheduling delays, mutex
waits, syscall blocks, heap growth, and more. These don't appear in application logs or metrics —
they're only visible inside the trace.

Without a way to set thresholds or run checks automatically, there's no practical path to catching
these issues in CI. You can't fail a build because a GC pause exceeded 20ms or flag a goroutine
count that keeps growing across releases.

Teams often end up investigating traces only when something is already slow in production.


Introducing gotracer

gotracer reads a Go execution trace, applies a set of
rules, and outputs findings — to the terminal, as JSON, or as an HTML report.

go install github.com/bright98/gotracer/cmd/gotracer@latest

curl -o trace.out "http://localhost:6060/debug/pprof/trace?seconds=5"
gotracer analyze trace.out

SEVERITY  RULE                   TIMESTAMP  MESSAGE
--------  ----                   ---------  -------
ERROR     GCPauseSpike           1.204s     GC pause of 45ms exceeds Error threshold (20ms)
WARN      HighSchedulingLatency  300ms      goroutine 42 waited 18ms to be scheduled

Eight rules are included: GC pauses, scheduling latency, mutex contention, syscall blocks, goroutine
leak growth, heap spikes, processor starvation, and GC mark assist waits. Each finding includes a
timestamp and a suggested fix; repeated occurrences are grouped with a count.


CI integration

gotracer exits 1 on any Warn or Error finding, so it can be used as a CI gate:

- run: gotracer analyze trace.out

If one code path triggers the same rule many times, --top N limits findings per rule:

gotracer analyze trace.out --top 3


Configuration

When used as a Go library, each rule's thresholds are configurable. This is useful when different
services have different latency requirements — a batch job and a low-latency API don't share the
same acceptable GC pause.


Implementation

gotracer is built on golang.org/x/exp/trace, the structured trace reader introduced in Go 1.22.
Each rule processes the event stream once, so memory usage stays low even on large traces.


Source and docs: github.com/bright98/gotracer