Esempio n. 1
0
// Configure creates a default newrelic client and adds middleware and such
func Configure(n *negroni.Negroni) error {
	cfg, err := config.LoadEnv()
	if err != nil {
		return err
	}

	ctl := control.NewAgentController(cfg)

	n.Use(NewRelicMiddleware(ctl, cfg))
	return nil
}
Esempio n. 2
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
}