Skip to content

leonnicolas/instrumented

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

instrumented

client

Instrument a net/http client as easy as:

package main

import (
	ic "github.com/leonnicolas/instrumented/client"
	"github.com/prometheus/client_golang/prometheus"
)

func main() {
	r := prometheus.NewRegistry()
	c := ic.NewInstrumentedClient(prometheus.WrapRegistererWithPrefix("prefix_", r))
	...
}

or instrument an existing client with:

hc := &http.Client{}

c := ic.InstrumentClient(hc, prometheus.WrapRegistererWithPrefix("prefix_", r))