newrelic

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

README

newrelic

Module for integrating with NewRelic and Gorilla Mux

Setup
import "gitlab.com/msts-public/general/gomods/newrelic"

func main() {
	config = newrelic.Config{
		APIKey:  "123...40",
		AppName: "MyApp",
		Enabled: true,
		Debug:   false,
	}

	nr, err := newrelic.NewNewRelic(config)
}

Config
type Config struct {
	APIKey   string  // NewRelic API Key
	AppName  string  // Application name - identity to use for new relic stats
	Enabled  bool    // Is new relic integration enabled
	Debug    bool    // Is new relic debug logging enabled
}

References:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.1.1

type Config struct {
	APIKey  string
	AppName string
	Enabled bool
	Debug   bool
}

Config -

type NewRelic

type NewRelic struct {
	// contains filtered or unexported fields
}

NewRelic -

func NewNewRelic

func NewNewRelic(l zerolog.Logger, c Config) (*NewRelic, error)

NewNewRelic -

func (*NewRelic) AddAttribute

func (nr *NewRelic) AddAttribute(key string, value interface{})

AddAttribute to the started transaction

func (*NewRelic) EndTransaction

func (nr *NewRelic) EndTransaction()

EndTransaction ends a started Transaction

func (*NewRelic) Init

func (nr *NewRelic) Init() error

Init -

func (*NewRelic) InstrumentRoutes

func (nr *NewRelic) InstrumentRoutes(r *mux.Router) *mux.Router

InstrumentRoutes instruments requests through the provided mux.Router.

func (*NewRelic) NoticeError

func (nr *NewRelic) NoticeError(err error)

NoticeError records an error on the transaction

func (*NewRelic) Shutdown

func (nr *NewRelic) Shutdown()

Shutdown flushes data to New Relic's servers and stops all agent-related goroutines managing this application.

func (*NewRelic) StartTransaction

func (nr *NewRelic) StartTransaction(name string) *newrelic.Transaction

StartTransaction begins a Transaction.

Jump to

Keyboard shortcuts

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