Skip to content

Latest commit

 

History

History
 
 

custom-instrumentation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Custom Instrumentation

This example demonstrates how to use go-httpbin's Observer mechanism to add custom instrumentation to a go-httpbin instance.

An observer is a function that will be called with an httpbin.Result struct after every request, which provides a hook for custom logging, metrics, or other instrumentation.

Note: This does require building your own small wrapper around go-httpbin, as you can see in main.go here. That's because go-httpbin has no dependencies outside of the Go stdlib, to make sure that it is as safe/lightweight as possible to include as a dependency in other applications' test suites where useful.