# README
newrelic
import "github.com/go-coldbrew/tracing/newrelic"
Index
- Variables
- func FinishNRTransaction(ctx context.Context, err error)
- func GetNewRelicApp() *newrelic.Application
- func GetNewRelicTransactionFromContext(ctx context.Context) *newrelic.Transaction
- func GetOrStartNew(ctx context.Context, name string) (*newrelic.Transaction, context.Context)
- func IgnoreNRTransaction(ctx context.Context)
- func SetNewRelicApp(nr *newrelic.Application)
- func StartNRTransaction(path string, ctx context.Context, req *http.Request, w http.ResponseWriter) context.Context
- func StoreNewRelicTransactionToContext(ctx context.Context, t *newrelic.Transaction) context.Context
Variables
var (
// NewRelicApp is the reference for newrelic application
NewRelicApp *newrelic.Application
)
func FinishNRTransaction
func FinishNRTransaction(ctx context.Context, err error)
FinishNRTransaction finishes an existing transaction if there is no transaction in the context, it does nothing
func GetNewRelicApp
func GetNewRelicApp() *newrelic.Application
func GetNewRelicTransactionFromContext
func GetNewRelicTransactionFromContext(ctx context.Context) *newrelic.Transaction
GetNewRelicTransactionFromContext fetches the new relic transaction that is stored in the context if there is no transaction in the context, it returns nil
func GetOrStartNew
func GetOrStartNew(ctx context.Context, name string) (*newrelic.Transaction, context.Context)
GetOrStartNew returns a new relic transaction from context if there is no transaction in the context, it starts a new transaction
func IgnoreNRTransaction
func IgnoreNRTransaction(ctx context.Context)
IgnoreNRTransaction ignores this NR trasaction and prevents it from being reported can be used to ignore health check transactions etc
func SetNewRelicApp
func SetNewRelicApp(nr *newrelic.Application)
func StartNRTransaction
func StartNRTransaction(path string, ctx context.Context, req *http.Request, w http.ResponseWriter) context.Context
StartNRTransaction starts a new newrelic transaction if there is already a transaction in the context, it will start a child transaction
func StoreNewRelicTransactionToContext
func StoreNewRelicTransactionToContext(ctx context.Context, t *newrelic.Transaction) context.Context
StoreNewRelicTransactionToContext stores a new relic transaction object to context if there is already a transaction in the context, it will be overwritten by the new one passed in the argument
Generated by gomarkdoc