{"id":49995,"library":"felixge-httpsnoop","title":"HTTP Snoop","description":"Package httpsnoop provides an easy way to capture HTTP-related metrics such as response time and status code by wrapping http.ResponseWriter.","status":"active","version":"1.1.0","language":"go","source_language":null,"source_url":"https://github.com/felixge/httpsnoop","tags":["http","metrics","middleware","monitoring"],"install":[{"cmd":"go get github.com/felixge/httpsnoop","lang":"bash","label":"Install github.com/felixge/httpsnoop"}],"dependencies":[],"imports":[{"symbol":"httpsnoop","correct":"github.com/felixge/httpsnoop"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"github.com/felixge/httpsnoop\"\n)\n\nfunc myHandler(w http.ResponseWriter, r *http.Request) {\n\tm := httpsnoop.CaptureMetrics(w, func(w http.ResponseWriter) {\n\t\tw.Write([]byte(\"Hello\"))\n\t})\n\tfmt.Printf(\"Status: %d, Duration: %v\\n\", m.Code, m.Duration)\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", myHandler)\n\thttp.ListenAndServe(\":8080\", nil)\n}","lang":"go","description":"Wraps an HTTP handler to capture metrics like status code and duration."},"warnings":[],"env_vars":null,"search_vec":"'captur':10 'code':21 'easi':7 'http':1,12,25 'http-relat':11 'http.responsewriter':24 'httpsnoop':4 'metric':14,26 'middlewar':27 'monitor':28 'packag':3 'provid':5 'relat':13 'respons':17 'snoop':2 'status':20 'time':18 'way':8 'wrap':23","created_at":"2026-06-15T04:36:04.209241+00:00","updated_at":"2026-06-15T04:36:04.209241+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/felixge/httpsnoop","github":"https://github.com/felixge/httpsnoop","docs":"https://pkg.go.dev/github.com/felixge/httpsnoop#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}