newrelic

package
v1.1.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabled

func IsEnabled() bool

IsEnabled reports whether the NewRelic middleware is enabled in the configuration.

func Module

func Module() fx.Option

Module returns fx module for initialization of event publisher middleware. Which depends on event wrapper provider module.

The module is only loaded once.

func NewNewRelic

func NewNewRelic() cloudevents.Middleware

NewNewRelic creates a newrelic agent middleware.

func TxName

func TxName() string

TxName returns the configured New Relic transaction name.

Types

type NewRelic

type NewRelic struct {
	cloudevents.UnimplementedMiddleware
}

NewRelic represents a newrelic agent middleware for events.

func (*NewRelic) After

func (m *NewRelic) After(parentCtx context.Context, in v2.Event, out *v2.Event, err error) (context.Context, error)

After checks if the handler has returned any error and notifies via newrelic agent.

func (*NewRelic) Before

func (m *NewRelic) Before(parentCtx context.Context, in *v2.Event) (context.Context, error)

Before enables the newrelic transacation for use in multiple goroutines to be used by the handler.

func (*NewRelic) BeforeAll

func (m *NewRelic) BeforeAll(ctx context.Context, inout []*cloudevents.InOut) (context.Context, error)

BeforeAll starts a newrelic transaction before processing all input event handlers. The transaction started is passed via context.

func (*NewRelic) Close

func (m *NewRelic) Close(ctx context.Context) error

Close finishes the newrelic transaction.

Jump to

Keyboard shortcuts

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