code: func (app *App) configureEvents(configuration *configuration.Configuration) {
  	// Configure all of the endpoint sinks.
  	var sinks []notifications.Sink
  	for _, endpoint := range configuration.Notifications.Endpoints {
  		if endpoint.Disabled {
  			dcontext.GetLogger(app).Infof("endpoint %s disabled, skipping", endpoint.Name)
  			continue
  		}
  
  		dcontext.GetLogger(app).Infof("configuring endpoint %v (%v), timeout=%s, headers=%v", endpoint.Name, endpoint.URL, endpoint.Timeout, endpoint.Headers)
  		endpoint := notifications.NewEndpoint(endpoint.Name, endpoint.URL, notifications.EndpointConfig{
  			Timeout:           endpoint.Timeout,
  			Threshold:         endpoint.Threshold,
  			Backoff:           endpoint.Backoff,
  			Headers:           endpoint.Headers,
  			IgnoredMediaTypes: endpoint.IgnoredMediaTypes,
  			Ignore:            endpoint.Ignore,
  		})
  
  		sinks = append(sinks, endpoint)
  	}
  
  	// NOTE(stevvooe): Moving to a new queuing implementation is as easy as
  	// replacing broadcaster with a rabbitmq implementation. It's recommended
  	// that the registry instances also act as the workers to keep deployment
  	// simple.
  	app.events.sink = notifications.NewBroadcaster(sinks...)
  
  	// Populate registry event source
  	hostname, err := os.Hostname()
  	if err != nil {
  		hostname = configuration.HTTP.Addr
  	} else {
  		// try to pick the port off the config
  		_, port, err := net.SplitHostPort(configuration.HTTP.Addr)
  		if err == nil {
  			hostname = net.JoinHostPort(hostname, port)
  		}
  	}
  
  	app.events.source = notifications.SourceRecord{
  		Addr:       hostname,
  		InstanceID: dcontext.GetStringValue(app, "instance.id"),
  	}
  }
docs: // configureEvents prepares the event sink for action.