watchdog

package
v0.0.0-...-b34fa9a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the watchdog client

func FromCtx

func FromCtx(ctx context.Context) *Client

func NewClient

func NewClient(ctx context.Context, cfg Config) (*Client, error)

NewClient returns a new instance of Client

func (*Client) Errorf

func (c *Client) Errorf(err error, extraMsg string, args ...interface{})

func (*Client) Flush

func (c *Client) Flush(maxWait time.Duration)

func (*Client) InstrumentPGSegment

func (c *Client) InstrumentPGSegment(dbHost, dbPort, dbName, query string) func()

InstrumentPGSegment starts a Postgres segment instrumentation. The return is the `End` func to close the segment We are unable to use nrpgx integration to instrument because there's a bug where it won't capture the query properly. Ref - https://github.com/newrelic/go-agent/issues/208 So instead we are constructing our own datastore segment using the same implementation as nrgpx, but additionally, also setting the ParameterizedQuery.

func (*Client) InstrumentSegment

func (c *Client) InstrumentSegment(name string, tags map[string]string) func()

func (*Client) InstrumentWebTxn

func (c *Client) InstrumentWebTxn(name string, w http.ResponseWriter, r *http.Request) (http.ResponseWriter, func())

func (*Client) LogDebugf

func (c *Client) LogDebugf(msg string, args ...interface{})

func (*Client) LogInfof

func (c *Client) LogInfof(msg string, args ...interface{})

func (*Client) LogWarnf

func (c *Client) LogWarnf(msg string, args ...interface{})

func (*Client) SetInCtx

func (c *Client) SetInCtx(ctx context.Context) context.Context

func (*Client) WithOperationID

func (c *Client) WithOperationID(id string) *Client

func (*Client) WithRequest

func (c *Client) WithRequest(r *http.Request) *Client

func (*Client) WithResponseInfo

func (c *Client) WithResponseInfo(status int, responseSize string, latency time.Duration) *Client

func (*Client) WithTag

func (c *Client) WithTag(k, v string) *Client

type Config

type Config struct {
	AppName   string
	Env       string
	Version   string
	DebugMode bool

	GCPProjectID string

	NewRelicLicense string

	SentryDSN string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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