Documentation ¶
Index ¶
- func InitNewRelic(cfg Config) error
- func RecordCustomEvent(eventType string, params map[string]interface{}) error
- func RecordCustomMetric(name string, value float64) error
- func Shutdown(timeout time.Duration)
- func StartTransaction(name string, w http.ResponseWriter, r *http.Request) newrelic.Transaction
- func WrapHandle(pattern string, handler http.Handler) (string, http.Handler)
- func WrapHandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
- type Config
- type NoopApp
- func (na NoopApp) RecordCustomEvent(eventType string, params map[string]interface{}) error
- func (na NoopApp) RecordCustomMetric(name string, value float64) error
- func (na NoopApp) Shutdown(timeout time.Duration)
- func (na NoopApp) StartTransaction(name string, w http.ResponseWriter, r *http.Request) newrelic.Transaction
- func (na NoopApp) WaitForConnection(timeout time.Duration) error
- type NoopTx
- func (nt *NoopTx) AcceptDistributedTracePayload(t newrelic.TransportType, payload interface{}) error
- func (nt *NoopTx) AddAttribute(key string, value interface{}) error
- func (nt *NoopTx) Application() newrelic.Application
- func (nt *NoopTx) BrowserTimingHeader() (*newrelic.BrowserTimingHeader, error)
- func (nt *NoopTx) CreateDistributedTracePayload() newrelic.DistributedTracePayload
- func (nt *NoopTx) End() error
- func (nt *NoopTx) GetLinkingMetadata() newrelic.LinkingMetadata
- func (nt *NoopTx) GetTraceMetadata() newrelic.TraceMetadata
- func (nt *NoopTx) Header() http.Header
- func (nt *NoopTx) Ignore() error
- func (nt *NoopTx) IsSampled() bool
- func (nt *NoopTx) NewGoroutine() newrelic.Transaction
- func (nt *NoopTx) NoticeError(err error) error
- func (nt *NoopTx) SetName(name string) error
- func (nt *NoopTx) SetWebRequest(newrelic.WebRequest) error
- func (nt *NoopTx) SetWebResponse(http.ResponseWriter) newrelic.Transaction
- func (nt *NoopTx) StartSegmentNow() newrelic.SegmentStartTime
- func (nt *NoopTx) Write(b []byte) (int, error)
- func (nt *NoopTx) WriteHeader(code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitNewRelic ¶
InitNewRelic initializes NewRelic Application.
func RecordCustomEvent ¶
RecordCustomEvent implements newrelic.Application interface.
func RecordCustomMetric ¶
RecordCustomMetric implements newrelic.Application interface.
func Shutdown ¶
Shutdown flushes data to New Relic's servers and stops all agent-related goroutines managing this application.
func StartTransaction ¶
func StartTransaction(name string, w http.ResponseWriter, r *http.Request) newrelic.Transaction
StartTransaction implements newrelic.Application interface.
func WrapHandle ¶
WrapHandle wraps newrelic.WrapHandle.
func WrapHandleFunc ¶
func WrapHandleFunc( pattern string, handler func(http.ResponseWriter, *http.Request), ) (string, func(http.ResponseWriter, *http.Request))
WrapHandleFunc wraps newrelic.WrapHandleFunc.
Types ¶
type Config ¶
type Config struct { Enabled bool AppName string License string Labels map[string]interface{} // https://docs.newrelic.com/docs/agents/go-agent/configuration/go-agent-configuration#error-ignore-status IgnoreStatusCodes []int }
Config stores NewRelic configuration.
type NoopApp ¶
type NoopApp struct{}
A NoopApp is a trivial, minimum overhead implementation of newrelic.Application for which all operations are no-ops.
func (NoopApp) RecordCustomEvent ¶
RecordCustomEvent implements newrelic.Application interface.
func (NoopApp) RecordCustomMetric ¶
RecordCustomMetric implements newrelic.Application interface.
func (NoopApp) StartTransaction ¶
func (na NoopApp) StartTransaction(name string, w http.ResponseWriter, r *http.Request) newrelic.Transaction
StartTransaction implements newrelic.Application interface.
type NoopTx ¶
type NoopTx struct {
// contains filtered or unexported fields
}
A NoopTx is a trivial, minimum overhead implementation of newrelic.Transaction for which all operations are no-ops.
func (*NoopTx) AcceptDistributedTracePayload ¶
func (nt *NoopTx) AcceptDistributedTracePayload(t newrelic.TransportType, payload interface{}) error
AcceptDistributedTracePayload implements newrelic.Transaction interface.
func (*NoopTx) AddAttribute ¶
AddAttribute implements newrelic.Transaction interface.
func (*NoopTx) Application ¶
func (nt *NoopTx) Application() newrelic.Application
Application implements newrelic.Transaction interface.
func (*NoopTx) BrowserTimingHeader ¶
func (nt *NoopTx) BrowserTimingHeader() (*newrelic.BrowserTimingHeader, error)
BrowserTimingHeader implements newrelic.Transaction interface.
func (*NoopTx) CreateDistributedTracePayload ¶
func (nt *NoopTx) CreateDistributedTracePayload() newrelic.DistributedTracePayload
CreateDistributedTracePayload implements newrelic.Transaction interface.
func (*NoopTx) GetLinkingMetadata ¶
func (nt *NoopTx) GetLinkingMetadata() newrelic.LinkingMetadata
GetLinkingMetadata implements newrelic.Transaction interface.
func (*NoopTx) GetTraceMetadata ¶
func (nt *NoopTx) GetTraceMetadata() newrelic.TraceMetadata
GetTraceMetadata implements newrelic.Transaction interface.
func (*NoopTx) NewGoroutine ¶
func (nt *NoopTx) NewGoroutine() newrelic.Transaction
NewGoroutine implements newrelic.Transaction interface.
func (*NoopTx) NoticeError ¶
NoticeError implements newrelic.Transaction interface.
func (*NoopTx) SetWebRequest ¶
func (nt *NoopTx) SetWebRequest(newrelic.WebRequest) error
SetWebRequest implements newrelic.Transaction interface.
func (*NoopTx) SetWebResponse ¶
func (nt *NoopTx) SetWebResponse(http.ResponseWriter) newrelic.Transaction
SetWebResponse implements newrelic.Transaction interface.
func (*NoopTx) StartSegmentNow ¶
func (nt *NoopTx) StartSegmentNow() newrelic.SegmentStartTime
StartSegmentNow implements newrelic.Transaction interface.
func (*NoopTx) WriteHeader ¶
WriteHeader implements http.ResponseWriter interface.