newrelic

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NewRelicApp is the reference for newrelic application
	NewRelicApp *newrelic.Application
)

Functions

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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