From d886b10f03b786ef1befa1b2f96126c8fff983b3 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:57:06 -0400 Subject: [PATCH 1/4] Give New Relic App a new name for testing --- backend/.profile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/.profile b/backend/.profile index fc2df6596a..3ba41a3076 100644 --- a/backend/.profile +++ b/backend/.profile @@ -19,7 +19,8 @@ export no_proxy="${S3_ENDPOINT_FOR_NO_PROXY},${S3_FIPS_ENDPOINT_FOR_NO_PROXY},${ export NEW_RELIC_LICENSE_KEY="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "newrelic-creds" ".[][] | select(.name == \$service_name) | .credentials.NEW_RELIC_LICENSE_KEY")" # Set the application name for New Relic telemetry. -export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)" +#export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)" +export NEW_RELIC_APP_NAME="$(echo "$VCAP_APPLICATION" | jq -r .application_name)-app" # Set the environment name for New Relic telemetry. export NEW_RELIC_ENVIRONMENT="$(echo "$VCAP_APPLICATION" | jq -r .space_name)" From 1c4b9a69b5646da79905cc0dd1cfaf25ca013285 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:57:43 -0400 Subject: [PATCH 2/4] Set logging to info and check logging --- backend/.profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/.profile b/backend/.profile index 3ba41a3076..7c85ac6148 100644 --- a/backend/.profile +++ b/backend/.profile @@ -29,7 +29,10 @@ export NEW_RELIC_ENVIRONMENT="$(echo "$VCAP_APPLICATION" | jq -r .space_name)" export NEW_RELIC_LOG=stdout # Logging level, (critical, error, warning, info and debug). Default to info -export NEW_RELIC_LOG_LEVEL=error +export NEW_RELIC_LOG_LEVEL=info + +export NEW_RELIC_APPLICATION_LOGGING_ENABLED=true +export NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=true # https://docs.newrelic.com/docs/security/security-privacy/compliance/fedramp-compliant-endpoints/ export NEW_RELIC_HOST="gov-collector.newrelic.com" From 2a0a2c8d9e1ff521dc8ef1420920168badc6ef00 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:58:30 -0400 Subject: [PATCH 3/4] Disable proxy vars, since with these unset, the agent worked --- backend/.profile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/.profile b/backend/.profile index 7c85ac6148..2ebdadbb66 100644 --- a/backend/.profile +++ b/backend/.profile @@ -37,14 +37,15 @@ export NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=true # https://docs.newrelic.com/docs/security/security-privacy/compliance/fedramp-compliant-endpoints/ export NEW_RELIC_HOST="gov-collector.newrelic.com" # https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/#proxy -https_proxy_protocol="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.protocol")" -https_proxy_domain="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.domain")" -https_proxy_port="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.port")" +#https_proxy_protocol="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.protocol")" +#https_proxy_domain="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.domain")" +#https_proxy_port="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.port")" -export NEW_RELIC_PROXY_HOST="$https_proxy_protocol://$https_proxy_domain" -export NEW_RELIC_PROXY_PORT="$https_proxy_port" -export NEW_RELIC_PROXY_USER="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.username")" -export NEW_RELIC_PROXY_PASS="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.password")" +#export NEW_RELIC_PROXY_SCHEME="$https_proxy_protocol" +#export NEW_RELIC_PROXY_HOST="$https_proxy_domain" +#export NEW_RELIC_PROXY_PORT="$https_proxy_port" +#export NEW_RELIC_PROXY_USER="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.username")" +#export NEW_RELIC_PROXY_PASS="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "https-proxy-creds" ".[][] | select(.name == \$service_name) | .credentials.password")" # We only want to run migrate and collecstatic for the first app instance, not # for additional app instances, so we gate all of this behind CF_INSTANCE_INDEX From 65c623756fb42ac312a56bb9b35387490f9606a5 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:59:34 -0400 Subject: [PATCH 4/4] Remove log forwarding --- backend/.profile | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/.profile b/backend/.profile index 2ebdadbb66..f3d33025ec 100644 --- a/backend/.profile +++ b/backend/.profile @@ -31,9 +31,6 @@ export NEW_RELIC_LOG=stdout # Logging level, (critical, error, warning, info and debug). Default to info export NEW_RELIC_LOG_LEVEL=info -export NEW_RELIC_APPLICATION_LOGGING_ENABLED=true -export NEW_RELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=true - # https://docs.newrelic.com/docs/security/security-privacy/compliance/fedramp-compliant-endpoints/ export NEW_RELIC_HOST="gov-collector.newrelic.com" # https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/#proxy