go-agent: github.com/newrelic/go-agent/v3/internal/integrationsupport Index | Files

package integrationsupport

import "github.com/newrelic/go-agent/v3/internal/integrationsupport"

Package integrationsupport exists to expose functionality to integration packages without adding noise to the public API.


Package Files



const (
    SampleAppName = "my app"

This code below is used for testing and is based on the similar code in internal_test.go in the newrelic package. That code is not exported, though, and we frequently need something similar for integration packages, so it is copied here.


var BasicConfigFn = func(cfg *newrelic.Config) {
    cfg.Enabled = false

BasicConfigFn is a default config function to be used when no special settings are needed for a test app

var DTEnabledCfgFn = func(cfg *newrelic.Config) {
    cfg.Enabled = false
    cfg.DistributedTracer.Enabled = true

DTEnabledCfgFn is a reusable Config function that sets Distributed Tracing to enabled

var SampleEverythingReplyFn = func(reply *internal.ConnectReply) {

SampleEverythingReplyFn is a reusable ConnectReply function that samples everything

func AddAgentAttribute Uses

func AddAgentAttribute(txn *newrelic.Transaction, id string, stringVal string, otherVal interface{})

AddAgentAttribute allows instrumentation packages to add agent attributes.

func AddAgentSpanAttribute Uses

func AddAgentSpanAttribute(txn *newrelic.Transaction, key string, val string)

AddAgentSpanAttribute allows instrumentation packages to add span attributes.

func ConfigFullTraces Uses

func ConfigFullTraces(cfg *newrelic.Config)

ConfigFullTraces enables distributed tracing and sets transaction trace and transaction trace segment thresholds to zero for full traces.

type ExpectApp Uses

type ExpectApp struct {

ExpectApp combines Application and Expect, for use in validating data in test apps

func NewBasicTestApp Uses

func NewBasicTestApp() ExpectApp

NewBasicTestApp creates an ExpectApp with the standard testing connect reply function and config

func NewTestApp Uses

func NewTestApp(replyfn func(*internal.ConnectReply), cfgFn ...newrelic.ConfigOption) ExpectApp

NewTestApp creates an ExpectApp with the given ConnectReply function and Config function

Package integrationsupport imports 2 packages (graph) and is imported by 6 packages. Updated 2020-07-16. Refresh now. Tools for package owners.