UNPKG

newrelic

Version:
210 lines (202 loc) 7.19 kB
'use strict' // Map of configuration values to their associated environment value names. const ENV_MAPPING = { newrelic_home: 'NEW_RELIC_HOME', app_name: 'NEW_RELIC_APP_NAME', license_key: 'NEW_RELIC_LICENSE_KEY', apdex_t: 'NEW_RELIC_APDEX_T', security_policies_token: 'NEW_RELIC_SECURITY_POLICIES_TOKEN', ssl: 'NEW_RELIC_USE_SSL', host: 'NEW_RELIC_HOST', port: 'NEW_RELIC_PORT', proxy: 'NEW_RELIC_PROXY_URL', proxy_host: 'NEW_RELIC_PROXY_HOST', proxy_port: 'NEW_RELIC_PROXY_PORT', proxy_user: 'NEW_RELIC_PROXY_USER', proxy_pass: 'NEW_RELIC_PROXY_PASS', ignore_server_configuration: 'NEW_RELIC_IGNORE_SERVER_CONFIGURATION', agent_enabled: 'NEW_RELIC_ENABLED', capture_params: 'NEW_RELIC_CAPTURE_PARAMS', ignored_params: 'NEW_RELIC_IGNORED_PARAMS', attributes: { enabled: 'NEW_RELIC_ATTRIBUTES_ENABLED', exclude: 'NEW_RELIC_ATTRIBUTES_EXCLUDE', include: 'NEW_RELIC_ATTRIBUTES_INCLUDE', include_enabled: 'NEW_RELIC_ATTRIBUTES_INCLUDE_ENABLED' }, logging: { level: 'NEW_RELIC_LOG_LEVEL', filepath: 'NEW_RELIC_LOG', enabled: 'NEW_RELIC_LOG_ENABLED' }, audit_log: { enabled: 'NEW_RELIC_AUDIT_LOG_ENABLED', endpoints: 'NEW_RELIC_AUDIT_LOG_ENDPOINTS' }, error_collector: { attributes: { enabled: 'NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLED' }, enabled: 'NEW_RELIC_ERROR_COLLECTOR_ENABLED', ignore_status_codes: 'NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES' }, strip_exception_messages: { enabled: 'NEW_RELIC_STRIP_EXCEPTION_MESSAGES_ENABLED' }, transaction_events: { attributes: { enabled: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED', exclude: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE', include: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE' } }, transaction_tracer: { attributes: { enabled: 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLED', exclude: 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDE', include: 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE' }, enabled: 'NEW_RELIC_TRACER_ENABLED', transaction_threshold: 'NEW_RELIC_TRACER_THRESHOLD', top_n: 'NEW_RELIC_TRACER_TOP_N', record_sql: 'NEW_RELIC_RECORD_SQL', explain_threshold: 'NEW_RELIC_EXPLAIN_THRESHOLD', hide_internals: 'NEW_RELIC_HIDE_INTERNALS' }, utilization: { detect_aws: 'NEW_RELIC_UTILIZATION_DETECT_AWS', detect_pcf: 'NEW_RELIC_UTILIZATION_DETECT_PCF', detect_azure: 'NEW_RELIC_UTILIZATION_DETECT_AZURE', detect_gcp: 'NEW_RELIC_UTILIZATION_DETECT_GCP', detect_docker: 'NEW_RELIC_UTILIZATION_DETECT_DOCKER', logical_processors: 'NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS', total_ram_mib: 'NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB', billing_hostname: 'NEW_RELIC_UTILIZATION_BILLING_HOSTNAME' }, rules: { name: 'NEW_RELIC_NAMING_RULES', ignore: 'NEW_RELIC_IGNORING_RULES' }, enforce_backstop: 'NEW_RELIC_ENFORCE_BACKSTOP', browser_monitoring: { attributes: { enabled: 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLED', exclude: 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDE', include: 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDE' }, enable: 'NEW_RELIC_BROWSER_MONITOR_ENABLE', debug: 'NEW_RELIC_BROWSER_MONITOR_DEBUG' }, high_security: 'NEW_RELIC_HIGH_SECURITY', labels: 'NEW_RELIC_LABELS', slow_sql: { enabled: 'NEW_RELIC_SLOW_SQL_ENABLED', max_samples: 'NEW_RELIC_MAX_SQL_SAMPLES' }, process_host: { display_name: 'NEW_RELIC_PROCESS_HOST_DISPLAY_NAME', ipv_preference: 'NEW_RELIC_IPV_PREFERENCE' }, api: { custom_attributes_enabled: 'NEW_RELIC_API_CUSTOM_ATTRIBUTES', custom_parameters_enabled: 'NEW_RELIC_API_CUSTOM_PARAMETERS', custom_events_enabled: 'NEW_RELIC_API_CUSTOM_EVENTS', notice_error_enabled: 'NEW_RELIC_API_NOTICE_ERROR' }, datastore_tracer: { instance_reporting: { enabled: 'NEW_RELIC_DATASTORE_INSTANCE_REPORTING_ENABLED' }, database_name_reporting:{ enabled: 'NEW_RELIC_DATASTORE_DATABASE_NAME_REPORTING_ENABLED' } }, span_events: { enabled: 'NEW_RELIC_SPAN_EVENTS_ENABLED' }, distributed_tracing: { enabled: 'NEW_RELIC_DISTRIBUTED_TRACING_ENABLED' }, message_tracer: { segment_parameters: { enabled: 'NEW_RELIC_MESSAGE_TRACER_SEGMENT_PARAMETERS_ENABLED' } }, serverless_mode: { enabled: 'NEW_RELIC_SERVERLESS_MODE_ENABLED' }, trusted_account_key: 'NEW_RELIC_TRUSTED_ACCOUNT_KEY', application_id: 'NEW_RELIC_APPLICATION_ID', account_id: 'NEW_RELIC_ACCOUNT_ID' } // List of environment values which are comma-delimited lists. const LIST_VARS = new Set([ 'NEW_RELIC_APP_NAME', 'NEW_RELIC_IGNORED_PARAMS', 'NEW_RELIC_ATTRIBUTES_EXCLUDE', 'NEW_RELIC_ATTRIBUTES_INCLUDE', 'NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES', 'NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_EXCLUDE', 'NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_INCLUDE', 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_EXCLUDE', 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_INCLUDE', 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_EXCLUDE', 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_INCLUDE', 'NEW_RELIC_IGNORING_RULES', 'NEW_RELIC_AUDIT_LOG_ENDPOINTS' ]) // Values in object lists are comma-delimited object literals const OBJECT_LIST_VARS = new Set([ 'NEW_RELIC_NAMING_RULES' ]) // Values in boolean variables. Is pretty tolerant about values, but don't get // fancy--just use 'true' and 'false', everybody. const BOOLEAN_VARS = new Set([ 'NEW_RELIC_IGNORE_SERVER_CONFIGURATION', 'NEW_RELIC_ENABLED', 'NEW_RELIC_CAPTURE_PARAMS', 'NEW_RELIC_ATTRIBUTES_ENABLED', 'NEW_RELIC_ERROR_COLLECTOR_ENABLED', 'NEW_RELIC_ERROR_COLLECTOR_ATTRIBUTES_ENABLED', 'NEW_RELIC_STRIP_EXCEPTION_MESSAGES_ENABLED', 'NEW_RELIC_ATTRIBUTES_INCLUDE_ENABLED', 'NEW_RELIC_TRACER_ENABLED', 'NEW_RELIC_TRANSACTION_TRACER_ATTRIBUTES_ENABLED', 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED', 'NEW_RELIC_DEBUG_METRICS', 'NEW_RELIC_DEBUG_TRACER', 'NEW_RELIC_ENFORCE_BACKSTOP', 'NEW_RELIC_USE_SSL', 'NEW_RELIC_BROWSER_MONITOR_ENABLE', 'NEW_RELIC_BROWSER_MONITORING_ATTRIBUTES_ENABLED', 'NEW_RELIC_BROWSER_MONITOR_DEBUG', 'NEW_RELIC_HIGH_SECURITY', 'NEW_RELIC_SLOW_SQL_ENABLED', 'NEW_RELIC_SPAN_EVENTS_ENABLED', 'NEW_RELIC_DISTRIBUTED_TRACING_ENABLED', 'NEW_RELIC_LOG_ENABLED', 'NEW_RELIC_AUDIT_LOG_ENABLED', 'NEW_RELIC_DATASTORE_DATABASE_NAME_REPORTING_ENABLED', 'NEW_RELIC_DATASTORE_INSTANCE_REPORTING_ENABLED', 'NEW_RELIC_MESSAGE_TRACER_SEGMENT_PARAMETERS_ENABLED', 'NEW_RELIC_UTILIZATION_DETECT_AWS', 'NEW_RELIC_UTILIZATION_DETECT_PCF', 'NEW_RELIC_UTILIZATION_DETECT_AZURE', 'NEW_RELIC_UTILIZATION_DETECT_DOCKER', 'NEW_RELIC_UTILIZATION_DETECT_GCP', 'NEW_RELIC_SERVERLESS_MODE_ENABLED' ]) const FLOAT_VARS = new Set([ 'NEW_RELIC_APDEX_T', 'NEW_RELIC_TRACER_THRESHOLD' ]) const INT_VARS = new Set([ 'NEW_RELIC_EXPLAIN_THRESHOLD', 'NEW_RELIC_MAX_SQL_SAMPLES' ]) exports.ENV_MAPPING = ENV_MAPPING exports.LIST_VARS = LIST_VARS exports.OBJECT_LIST_VARS = OBJECT_LIST_VARS exports.BOOLEAN_VARS = BOOLEAN_VARS exports.FLOAT_VARS = FLOAT_VARS exports.INT_VARS = INT_VARS