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

package integrationsupport

import "github.com/newrelic/go-agent/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) {
    reply.AdaptiveSampler = internal.SampleEverything{}

SampleEverythingReplyFn is a reusable ConnectReply function that samples everything

func AddAgentAttribute Uses

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

AddAgentAttribute allows instrumentation packages to add agent attributes.

func AddAgentSpanAttribute Uses

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

AddAgentSpanAttribute allows instrumentation packages to add span attributes.

type ExpectApp Uses

type ExpectApp interface {

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 func(*newrelic.Config)) ExpectApp

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

Package integrationsupport imports 2 packages (graph) and is imported by 5 packages. Updated 2019-11-26. Refresh now. Tools for package owners.