v1.6.2 Latest Latest

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 9 Imported by: 0




This section is empty.


This section is empty.


func AddAttribute

func AddAttribute(ctx context.Context, key string, value interface{}) context.Context

AddAttribute to add attribute to span

func EndTransaction

func EndTransaction(ctx context.Context)

EndTransaction to end NR transaction from context

func Error

func Error(ctx context.Context, err error) error

Error to notice error to NR

func GetMetadataFromContext

func GetMetadataFromContext(ctx context.Context) http.Header

func Init

func Init(cfg Config) (err error)

Init to initialize new relic in go app

func StartGinTransactionWithName

func StartGinTransactionWithName(c *gin.Context, name string) *gin.Context

StartGinTransactionWithName start gin request trx

func StartNSQSegment

func StartNSQSegment(ctx context.Context, topicName string) *newrelic.MessageProducerSegment

StartNSQSegment starts a new relic segment for NSQ produce topic

func StartPostgresSegment

func StartPostgresSegment(ctx context.Context, query, collection, operation string, params map[string]interface{}) *newrelic.DatastoreSegment

StartPostgresSegment to start a postgres segment

func StartPostgresSegmentWithDBName

func StartPostgresSegmentWithDBName(
	ctx context.Context, dbName, dbHost, dbPort, query, collection, operation string, params map[string]interface{},
) *newrelic.DatastoreSegment

StartPostgresSegmentWithDBName to start a postgres segment with DB name & the DB host

func StartSegment

func StartSegment(ctx context.Context, name string) *newrelic.Segment

StartSegment start segment

func StartTransactionWithName

func StartTransactionWithName(ctx context.Context, name string) context.Context

StartTransactionWithName to create a new Transaction with Name


type Config

type Config struct {
	AppName   string
	SecretKey string
	LogLevel  string

Jump to

Keyboard shortcuts

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