code: func NewRetrier(opts Options) Retrier {
  	scope := opts.MetricsScope()
  	errorTags := struct {
  		retryable    map[string]string
  		notRetryable map[string]string
  	}{
  		map[string]string{
  			"type": "retryable",
  		},
  		map[string]string{
  			"type": "not-retryable",
  		},
  	}
  	return &retrier{
  		initialBackoff: opts.InitialBackoff(),
  		backoffFactor:  opts.BackoffFactor(),
  		maxBackoff:     opts.MaxBackoff(),
  		maxRetries:     opts.MaxRetries(),
  		forever:        opts.Forever(),
  		jitter:         opts.Jitter(),
  		rngFn:          opts.RngFn(),
  		sleepFn:        time.Sleep,
  		metrics: retrierMetrics{
  			success:            scope.Counter("success"),
  			successLatency:     scope.Timer("success-latency"),
  			errors:             scope.Tagged(errorTags.retryable).Counter("errors"),
  			errorsNotRetryable: scope.Tagged(errorTags.notRetryable).Counter("errors"),
  			errorsFinal:        scope.Counter("errors-final"),
  			errorsLatency:      scope.Timer("errors-latency"),
  			retries:            scope.Counter("retries"),
  		},
  	}
  }
docs: // NewRetrier creates a new retrier.