newrelic_atreugo

package module
v0.0.0-...-9a04aee Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 8 Imported by: 0

README

newrelic-atreugo

NewRelic instrumentation middleware for Atreugo

example

import (
"github.com/newrelic/go-agent/v3/newrelic"
newrelicAtreugo "github.com/kunal-saini/newrelic-atreugo"
)

newrelicApp, err := newrelic.NewApplication(
    newrelic.ConfigAppName("app name"),
    newrelic.ConfigLicense("license"),
    newrelic.ConfigDistributedTracerEnabled(true),
)

newrelicAtreugoMiddleware := newrelicAtreugo.NewRelicAtreugoWrapper(newrelicApp)
server := atreugo.New(atreugo.Config{
	Addr: "0.0.0.0:3000", 
	PanicView: newrelicAtreugoMiddleware.PanicView()
})

server.UseBefore(newrelicAtreugoMiddleware.BeginInstrumentationMiddleware())
server.UseAfter(newrelicAtreugoMiddleware.EndInstrumentationMiddleware())

Documentation

Index

Constants

View Source
const NewRelicTransaction = "__newrelic_transaction__"

Variables

This section is empty.

Functions

This section is empty.

Types

type NewRelicAtreugo

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

func NewRelicAtreugoWrapper

func NewRelicAtreugoWrapper(nra *newrelic.Application) *NewRelicAtreugo

func NewRelicAtreugoWrapperWithOptions

func NewRelicAtreugoWrapperWithOptions(nra *newrelic.Application, ops *Options) *NewRelicAtreugo

func (*NewRelicAtreugo) BeginInstrumentationMiddleware

func (n *NewRelicAtreugo) BeginInstrumentationMiddleware() atreugo.Middleware

BeginInstrumentationMiddleware returns a middleware.

func (*NewRelicAtreugo) EndInstrumentationMiddleware

func (n *NewRelicAtreugo) EndInstrumentationMiddleware() atreugo.Middleware

EndInstrumentationMiddleware returns a middleware.

func (*NewRelicAtreugo) PanicView

func (n *NewRelicAtreugo) PanicView() atreugo.PanicView

PanicView returns a panic view.

type Options

type Options struct {
	InstrumentResponseBody bool
}

type Response

type Response struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*Response) Header

func (w *Response) Header() http.Header

func (*Response) String

func (w *Response) String() string

func (*Response) WriteHeader

func (w *Response) WriteHeader(h int)

Jump to

Keyboard shortcuts

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