示例#1
0
// Configure creates a default newrelic client and adds middleware and such
func Configure(m *martini.ClassicMartini) error {
	cfg, err := config.LoadEnv()
	if err != nil {
		return err
	}

	ctl := control.NewAgentController(cfg)

	m.MapTo(ctl, (*control.Controller)(nil))
	m.Use(NewRelicMiddleware(cfg))
	return nil
}