Documentation
¶
Index ¶
- type Provider
- func (p *Provider) Application() *newrelic.Application
- func (p *Provider) RecordCount(metricName string, count uint64)
- func (p *Provider) RecordDuration(metricName string, duration time.Duration)
- func (p *Provider) RecordEvent(eventName string, attributes map[string]interface{})
- func (p *Provider) StartTrace(name string) metrics.Trace
- type Span
- type Trace
- func (t *Trace) AddAttribute(key string, value interface{})
- func (t *Trace) End()
- func (t *Trace) OnError(err error)
- func (t *Trace) SetRequest(r metrics.Request)
- func (t *Trace) SetResponse(w http.ResponseWriter) http.ResponseWriter
- func (t *Trace) StartSpan(name string) metrics.Span
- func (t *Trace) Unwrap() *newrelic.Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps a New Relic application to implement the metrics.Provider interface
func NewProvider ¶
func NewProvider(app *newrelic.Application) *Provider
NewProvider creates a new New Relic metrics provider
func (*Provider) Application ¶
func (p *Provider) Application() *newrelic.Application
Application returns the underlying New Relic application for cases where direct access is needed (e.g., log integration)
func (*Provider) RecordCount ¶
RecordCount records a count metric
func (*Provider) RecordDuration ¶
RecordDuration records a duration metric
func (*Provider) RecordEvent ¶
RecordEvent records a custom event with key-value attributes
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span wraps a New Relic segment
func (*Span) AddAttribute ¶
AddAttribute adds a key-value attribute to the span
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
Trace wraps a New Relic transaction
func (*Trace) AddAttribute ¶
AddAttribute adds a key-value attribute to the trace
func (*Trace) SetRequest ¶
SetRequest sets HTTP request information on the trace
func (*Trace) SetResponse ¶
func (t *Trace) SetResponse(w http.ResponseWriter) http.ResponseWriter
SetResponse sets the HTTP response writer for the trace
func (*Trace) Unwrap ¶
func (t *Trace) Unwrap() *newrelic.Transaction
Unwrap returns the underlying New Relic transaction for advanced use cases