Documentation ¶
Overview ¶
Package integrationsupport exists to expose functionality to integration packages without adding noise to the public API.
Index ¶
Constants ¶
const ( SampleAppName = "my app" TestEntityGUID = "testEntityGUID123" )
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.
Variables ¶
var AppLogEnabledCfgFn = func(cfg *newrelic.Config) { cfg.Enabled = false cfg.ApplicationLogging.Enabled = true cfg.ApplicationLogging.Forwarding.Enabled = true cfg.ApplicationLogging.Metrics.Enabled = true }
AppLogEnabledCfgFn enables application logging features
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.SetSampleEverything() reply.EntityGUID = TestEntityGUID reply.EventData = internal.DefaultEventHarvestConfig(internal.MaxTxnEvents, internal.MaxLogEvents, internal.MaxCustomEvents) }
SampleEverythingReplyFn is a reusable ConnectReply function that samples everything
Functions ¶
func AddAgentAttribute ¶
func AddAgentAttribute(txn *newrelic.Transaction, id string, stringVal string, otherVal interface{})
AddAgentAttribute allows instrumentation packages to add agent attributes.
func AddAgentSpanAttribute ¶
func AddAgentSpanAttribute(txn *newrelic.Transaction, key string, val string)
AddAgentSpanAttribute allows instrumentation packages to add span attributes.
func ConfigFullTraces ¶
ConfigFullTraces enables distributed tracing and sets transaction trace and transaction trace segment thresholds to zero for full traces.
Types ¶
type ExpectApp ¶
type ExpectApp struct { internal.Expect *newrelic.Application }
ExpectApp combines Application and Expect, for use in validating data in test apps
func NewBasicTestApp ¶
func NewBasicTestApp() ExpectApp
NewBasicTestApp creates an ExpectApp with the standard testing connect reply function and config
func NewTestApp ¶
func NewTestApp(replyfn func(*internal.ConnectReply), cfgFn ...newrelic.ConfigOption) ExpectApp
NewTestApp creates an ExpectApp with the given ConnectReply function and Config function