Documentation ¶
Index ¶
- Constants
- func RecordCount(ctx context.Context, metricName string, count uint64)
- func RecordDuration(ctx context.Context, metricName string, duration time.Duration)
- func RecordEvent(ctx context.Context, eventName string, kvPairs map[string]interface{})
- type CustomNewRelicContextLogFormatter
- type MethodTracer
Constants ¶
const (
NewRelicContextKey = "newrelic_context"
)
Variables ¶
This section is empty.
Functions ¶
func RecordCount ¶
RecordCount records a count metric
func RecordDuration ¶
RecordDuration records a duration metric
Types ¶
type CustomNewRelicContextLogFormatter ¶
type CustomNewRelicContextLogFormatter struct {
// contains filtered or unexported fields
}
CustomNewRelicContextLogFormatter is a logrus.Formatter that will format logs for sending to New Relic. This is a custom implementation that includes sending all logrus.Entry.Fields, which isn't supported out of the box yet
func NewCustomNewRelicLogFormatter ¶
func NewCustomNewRelicLogFormatter(app *newrelic.Application, formatter logrus.Formatter) CustomNewRelicContextLogFormatter
type MethodTracer ¶
type MethodTracer struct {
// contains filtered or unexported fields
}
MethodTracer collects analytics for a given method call within an existing trace.
func TraceMethodCall ¶
func TraceMethodCall(ctx context.Context, structOrPackageName, methodName string) *MethodTracer
TraceMethodCall traces a method call with a given struct/package and method names
func (*MethodTracer) AddAttribute ¶
func (t *MethodTracer) AddAttribute(key string, value interface{})
AddAttribute adds a key-value pair metadata to the method trace
func (*MethodTracer) AddAttributes ¶
func (t *MethodTracer) AddAttributes(attributes map[string]interface{})
AddAttributes adds a set of key-value pair metadata to the method trace
func (*MethodTracer) End ¶
func (t *MethodTracer) End()
End completes the trace for the method call.
func (*MethodTracer) OnError ¶
func (t *MethodTracer) OnError(err error)
OnError observes an error within a method trace