Skip to content

Commit

Permalink
Comment clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
mirackara committed Jun 29, 2022
2 parents 312f581 + d5919d5 commit da36b6e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions v3/newrelic/config.go
Expand Up @@ -383,7 +383,6 @@ func defaultConfig() Config {
c.Enabled = true
c.Labels = make(map[string]string)
c.CustomInsightsEvents.Enabled = true
c.CustomInsightsEvents.MaxSamplesStored = internal.MaxCustomEvents
c.TransactionEvents.Enabled = true
c.TransactionEvents.Attributes.Enabled = true
c.TransactionEvents.MaxSamplesStored = internal.MaxTxnEvents
Expand Down Expand Up @@ -505,16 +504,6 @@ func (c Config) validateTraceObserverConfig() (*observerURL, error) {
}, nil
}

// maxCustomEvents returns the configured maximum number of Custom Events if it has been configured
// and is less than the default maximum; otherwise it returns the default max.
func (c Config) maxCustomEvents() int {
configured := c.CustomInsightsEvents.MaxSamplesStored
if configured < 0 || configured > internal.MaxCustomEvents {
return internal.MaxTxnEvents
}
return configured
}

// maxTxnEvents returns the configured maximum number of Transaction Events if it has been configured
// and is less than the default maximum; otherwise it returns the default max.
func (c Config) maxTxnEvents() int {
Expand Down Expand Up @@ -679,7 +668,7 @@ func configConnectJSONInternal(c Config, pid int, util *utilization.Data, e envi
Util: util,
SecurityPolicies: securityPolicies,
Metadata: metadata,
EventData: internal.DefaultEventHarvestConfigWithDT(c.maxTxnEvents(), c.DistributedTracer.Enabled, c.DistributedTracer.ReservoirLimit, c.maxCustomEvents()),
EventData: internal.DefaultEventHarvestConfigWithDT(c.maxTxnEvents(), c.DistributedTracer.Enabled, c.DistributedTracer.ReservoirLimit),
}})
}

Expand Down

0 comments on commit da36b6e

Please sign in to comment.