func WithFailures(a xmetrics.Adder) InstrumentOption {
	return func(io *instrumentOptions) {
		if a != nil {
			io.failures = a
		} else {
			io.failures = discard.NewCounter()
		}
	}
}
WithFailures establishes a metric that tracks how many times a resource was unable to
be acquired, due to timeouts, context cancellations, etc.
package semaphore
import (
	"context"
	"time"
	"github.com/go-kit/kit/metrics/discard"
	"github.com/xmidt-org/webpa-common/v2/xmetrics"
)
const (
	MetricOpen   float64 = 1.0
	MetricClosed float64 = 0.0
)
type instrumentOptions struct {
	failures  xmetrics.Adder
	resources xmetrics.Adder
	closed    xmetrics.Setter
}
var defaultOptions = instrumentOptions{
	failures:  discard.NewCounter(),
	resources: discard.NewCounter(),
	closed:    discard.NewGauge(),
}
type InstrumentOption func(*instrumentOptions)
func WithResources(a xmetrics.Adder) InstrumentOption {
	return func(io *instrumentOptions) {
		if a != nil {
			io.resources = a
		} else {
			io.resources = discard.NewCounter()
		}
	}
}