Skip to content

Commit 603fa44

Browse files
committed
Support newrelic v3
1 parent 718a69b commit 603fa44

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

stats/newrelic/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/wantedly/subee/stats/newrelic
33
go 1.13
44

55
require (
6-
github.com/newrelic/go-agent v2.14.1+incompatible
6+
github.com/newrelic/go-agent/v3 v3.2.0
77
github.com/wantedly/subee v0.5.0
88
)

stats/newrelic/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/newrelic/go-agent v2.14.1+incompatible h1:rh+3g1mhz8WH3VD/ORq3QhQz4iqaClBlQ6q9KInojyE=
2-
github.com/newrelic/go-agent v2.14.1+incompatible/go.mod h1:a8Fv1b/fYhFSReoTU6HDkTYIMZeSVNffmoS726Y0LzQ=
1+
github.com/newrelic/go-agent/v3 v3.2.0 h1:VyVCJYgqNCMSa5b92dcREL7fxNIobTw6DVolTWJDJJs=
2+
github.com/newrelic/go-agent/v3 v3.2.0/go.mod h1:H28zDNUC0U/b7kLoY4EFOhuth10Xu/9dchozUiOseQQ=
33
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
44
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
55
github.com/wantedly/subee v0.5.0 h1:MXGlZYHNVxyxsolIcpwymdZHMR9OL8WlggCwu8//I0M=

stats/newrelic/newrelic.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package nrsubee
33
import (
44
"context"
55

6-
newrelic "github.com/newrelic/go-agent"
6+
"github.com/newrelic/go-agent/v3/newrelic"
77

88
"github.com/wantedly/subee"
99
)
1010

1111
// NewStatsHandler creates a new subee.StatsHandler instance for measuring application performances with New Relic.
12-
func NewStatsHandler(app newrelic.Application, opts ...Option) subee.StatsHandler {
12+
func NewStatsHandler(app *newrelic.Application, opts ...Option) subee.StatsHandler {
1313
cfg := DefaultConfig()
1414
cfg.apply(opts)
1515
return &statsHandler{
@@ -19,7 +19,7 @@ func NewStatsHandler(app newrelic.Application, opts ...Option) subee.StatsHandle
1919
}
2020

2121
type statsHandler struct {
22-
app newrelic.Application
22+
app *newrelic.Application
2323
cfg *Config
2424
}
2525

@@ -31,7 +31,7 @@ type (
3131
func (sh *statsHandler) TagProcess(ctx context.Context, t subee.Tag) context.Context {
3232
switch t.(type) {
3333
case *subee.EnqueueTag:
34-
txn := sh.app.StartTransaction(sh.cfg.TransactionName, nil, nil)
34+
txn := sh.app.StartTransaction(sh.cfg.TransactionName)
3535
ctx := newrelic.NewContext(ctx, txn)
3636
seg := newrelic.StartSegment(txn, sh.cfg.QueueingSegmentName)
3737
return context.WithValue(ctx, queueContextKey{}, seg)

0 commit comments

Comments
 (0)