newrelic

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const NewRelicTransaction = "__newrelic_transaction__"

Variables

This section is empty.

Functions

func Application

func Application() *newrelic.Application

Application initialize the new newrelic application singleton, if required, and/or return it.

func Debug

func Debug() bool

Debug returns debug config value.

func FromContext

func FromContext(ctx context.Context) *newrelic.Transaction

FromContext returns the newrelic transaction from context.

func IsEnabled

func IsEnabled() bool

IsEnabled returns enabled config value.

func NewApplication

func NewApplication(ctx context.Context) (*newrelic.Application, error)

NewApplication always initialize the new newrelic application singleton if enabled.

func NewLogger

func NewLogger() newrelic.Logger

NewLogger returns a new logger instance.

Types

type Logger

type Logger struct {
}

Logger represents a newrelic logger.

func (*Logger) Debug

func (l *Logger) Debug(msg string, context map[string]interface{})

Debug logs debug message.

func (*Logger) DebugEnabled

func (l *Logger) DebugEnabled() bool

DebugEnabled returns debug config value.

func (*Logger) Error

func (l *Logger) Error(msg string, context map[string]interface{})

Error logs error message.

func (*Logger) Info

func (l *Logger) Info(msg string, context map[string]interface{})

Info logs info message.

func (*Logger) Warn

func (l *Logger) Warn(msg string, context map[string]interface{})

Warn logs warn message.

type MessageMetricKey

type MessageMetricKey struct {
	Library         string
	DestinationType string
	Consumer        bool
	DestinationName string
	DestinationTemp bool
}

MessageMetricKey is the key to use for message segments.

func (MessageMetricKey) Name

func (key MessageMetricKey) Name() string

Name returns the metric name value for this MessageMetricKey to be used for scoped and unscoped metrics.

Producers MessageBroker/{Library}/{Destination Type}/{Action}/Named/{Destination Name} MessageBroker/{Library}/{Destination Type}/{Action}/Temp

Consumers OtherTransaction/Message/{Library}/{DestinationType}/Named/{Destination Name} OtherTransaction/Message/{Library}/{DestinationType}/Temp

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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