newrelic

package
v1.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitNewRelic

func InitNewRelic(cfg Config) error

InitNewRelic initializes NewRelic Application.

func RecordCustomEvent

func RecordCustomEvent(eventType string, params map[string]interface{}) error

RecordCustomEvent implements newrelic.Application interface.

func RecordCustomMetric

func RecordCustomMetric(name string, value float64) error

RecordCustomMetric implements newrelic.Application interface.

func Shutdown

func Shutdown(timeout time.Duration)

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

func WrapHandle(pattern string, handler http.Handler) (string, http.Handler)

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

func (na NoopApp) RecordCustomEvent(eventType string, params map[string]interface{}) error

RecordCustomEvent implements newrelic.Application interface.

func (NoopApp) RecordCustomMetric

func (na NoopApp) RecordCustomMetric(name string, value float64) error

RecordCustomMetric implements newrelic.Application interface.

func (NoopApp) Shutdown

func (na NoopApp) Shutdown(timeout time.Duration)

Shutdown 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.

func (NoopApp) WaitForConnection

func (na NoopApp) WaitForConnection(timeout time.Duration) error

WaitForConnection 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

func (nt *NoopTx) AddAttribute(key string, value interface{}) error

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) End

func (nt *NoopTx) End() error

End 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) Header

func (nt *NoopTx) Header() http.Header

Header implements http.ResponseWriter interface.

func (*NoopTx) Ignore

func (nt *NoopTx) Ignore() error

Ignore implements newrelic.Transaction interface.

func (*NoopTx) IsSampled added in v1.4.7

func (nt *NoopTx) IsSampled() bool

func (*NoopTx) NewGoroutine

func (nt *NoopTx) NewGoroutine() newrelic.Transaction

NewGoroutine implements newrelic.Transaction interface.

func (*NoopTx) NoticeError

func (nt *NoopTx) NoticeError(err error) error

NoticeError implements newrelic.Transaction interface.

func (*NoopTx) SetName

func (nt *NoopTx) SetName(name string) error

SetName 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) Write

func (nt *NoopTx) Write(b []byte) (int, error)

Write implements http.ResponseWriter interface.

func (*NoopTx) WriteHeader

func (nt *NoopTx) WriteHeader(code int)

WriteHeader implements http.ResponseWriter interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL