package
0.0.6
Repository: https://github.com/go-coldbrew/tracing.git
Documentation: pkg.go.dev

# README

GoDoc

newrelic

import "github.com/go-coldbrew/tracing/newrelic"

Index

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

# Functions

FinishNRTransaction finishes an existing transaction if there is no transaction in the context, it does nothing.
No description provided by the author
GetNewRelicTransactionFromContext fetches the new relic transaction that is stored in the context if there is no transaction in the context, it returns nil.
GetOrStartNew returns a new relic transaction from context if there is no transaction in the context, it starts a new transaction.
IgnoreNRTransaction ignores this NR trasaction and prevents it from being reported can be used to ignore health check transactions etc.
No description provided by the author
StartNRTransaction starts a new newrelic transaction if there is already a transaction in the context, it will start a child transaction.
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.

# Variables

NewRelicApp is the reference for newrelic application.