Skip to content

Commit

Permalink
add config option to toggle customEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
iamemilio committed Oct 21, 2022
1 parent 5db76df commit 3e1f210
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Expand Up @@ -51,6 +51,8 @@ jobs:
- go-version: 1.13.x
dirs: _integrations/nrecho
pin: github.com/labstack/echo@v3.3.10
- go-version: 1.13.x
dirs: _integrations/nrgin/v1
- go-version: 1.13.x
dirs: _integrations/nrgorilla/v1
- go-version: 1.13.x
Expand Down
51 changes: 28 additions & 23 deletions v3/newrelic/config_options.go
Expand Up @@ -47,6 +47,11 @@ func ConfigCustomInsightsEventsMaxSamplesStored(limit int) ConfigOption {
return func(cfg *Config) { cfg.CustomInsightsEvents.MaxSamplesStored = limit }
}

// ConfigCustomInsightsEventsEnabled enables or disables the collection of custom insight events.
func ConfigCustomInsightsEventsEnabled(enabled bool) ConfigOption {
return func(cfg *Config) { cfg.CustomInsightsEvents.Enabled = enabled }
}

// ConfigDistributedTracerReservoirLimit alters the sample reservoir size (maximum
// number of span events to be collected) for distributed tracing instead of
// using the built-in default.
Expand Down Expand Up @@ -208,29 +213,29 @@ func ConfigDebugLogger(w io.Writer) ConfigOption {

// ConfigFromEnvironment populates the config based on environment variables:
//
// NEW_RELIC_APP_NAME sets AppName
// NEW_RELIC_ATTRIBUTES_EXCLUDE sets Attributes.Exclude using a comma-separated list, eg. "request.headers.host,request.method"
// NEW_RELIC_ATTRIBUTES_INCLUDE sets Attributes.Include using a comma-separated list
// NEW_RELIC_CODE_LEVEL_METRICS_ENABLED sets CodeLevelMetrics.Enabled
// NEW_RELIC_CODE_LEVEL_METRICS_SCOPE sets CodeLevelMetrics.Scope using a comma-separated list, e.g. "transaction"
// NEW_RELIC_CODE_LEVEL_METRICS_PATH_PREFIX sets CodeLevelMetrics.PathPrefixes using a comma-separated list
// NEW_RELIC_CODE_LEVEL_METRICS_IGNORED_PREFIX sets CodeLevelMetrics.IgnoredPrefixes using a comma-separated list
// NEW_RELIC_DISTRIBUTED_TRACING_ENABLED sets DistributedTracer.Enabled using strconv.ParseBool
// NEW_RELIC_ENABLED sets Enabled using strconv.ParseBool
// NEW_RELIC_HIGH_SECURITY sets HighSecurity using strconv.ParseBool
// NEW_RELIC_HOST sets Host
// NEW_RELIC_INFINITE_TRACING_SPAN_EVENTS_QUEUE_SIZE sets InfiniteTracing.SpanEvents.QueueSize using strconv.Atoi
// NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT sets InfiniteTracing.TraceObserver.Port using strconv.Atoi
// NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_HOST sets InfiniteTracing.TraceObserver.Host
// NEW_RELIC_LABELS sets Labels using a semi-colon delimited string of colon-separated pairs, eg. "Server:One;DataCenter:Primary"
// NEW_RELIC_LICENSE_KEY sets License
// NEW_RELIC_LOG sets Logger to log to either "stdout" or "stderr" (filenames are not supported)
// NEW_RELIC_LOG_LEVEL controls the NEW_RELIC_LOG level, must be "debug" for debug, or empty for info
// NEW_RELIC_PROCESS_HOST_DISPLAY_NAME sets HostDisplayName
// NEW_RELIC_SECURITY_POLICIES_TOKEN sets SecurityPoliciesToken
// NEW_RELIC_UTILIZATION_BILLING_HOSTNAME sets Utilization.BillingHostname
// NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS sets Utilization.LogicalProcessors using strconv.Atoi
// NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB sets Utilization.TotalRAMMIB using strconv.Atoi
// NEW_RELIC_APP_NAME sets AppName
// NEW_RELIC_ATTRIBUTES_EXCLUDE sets Attributes.Exclude using a comma-separated list, eg. "request.headers.host,request.method"
// NEW_RELIC_ATTRIBUTES_INCLUDE sets Attributes.Include using a comma-separated list
// NEW_RELIC_CODE_LEVEL_METRICS_ENABLED sets CodeLevelMetrics.Enabled
// NEW_RELIC_CODE_LEVEL_METRICS_SCOPE sets CodeLevelMetrics.Scope using a comma-separated list, e.g. "transaction"
// NEW_RELIC_CODE_LEVEL_METRICS_PATH_PREFIX sets CodeLevelMetrics.PathPrefixes using a comma-separated list
// NEW_RELIC_CODE_LEVEL_METRICS_IGNORED_PREFIX sets CodeLevelMetrics.IgnoredPrefixes using a comma-separated list
// NEW_RELIC_DISTRIBUTED_TRACING_ENABLED sets DistributedTracer.Enabled using strconv.ParseBool
// NEW_RELIC_ENABLED sets Enabled using strconv.ParseBool
// NEW_RELIC_HIGH_SECURITY sets HighSecurity using strconv.ParseBool
// NEW_RELIC_HOST sets Host
// NEW_RELIC_INFINITE_TRACING_SPAN_EVENTS_QUEUE_SIZE sets InfiniteTracing.SpanEvents.QueueSize using strconv.Atoi
// NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT sets InfiniteTracing.TraceObserver.Port using strconv.Atoi
// NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_HOST sets InfiniteTracing.TraceObserver.Host
// NEW_RELIC_LABELS sets Labels using a semi-colon delimited string of colon-separated pairs, eg. "Server:One;DataCenter:Primary"
// NEW_RELIC_LICENSE_KEY sets License
// NEW_RELIC_LOG sets Logger to log to either "stdout" or "stderr" (filenames are not supported)
// NEW_RELIC_LOG_LEVEL controls the NEW_RELIC_LOG level, must be "debug" for debug, or empty for info
// NEW_RELIC_PROCESS_HOST_DISPLAY_NAME sets HostDisplayName
// NEW_RELIC_SECURITY_POLICIES_TOKEN sets SecurityPoliciesToken
// NEW_RELIC_UTILIZATION_BILLING_HOSTNAME sets Utilization.BillingHostname
// NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS sets Utilization.LogicalProcessors using strconv.Atoi
// NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB sets Utilization.TotalRAMMIB using strconv.Atoi
//
// This function is strict and will assign Config.Error if any of the
// environment variables cannot be parsed.
Expand Down

0 comments on commit 3e1f210

Please sign in to comment.