Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .envs/.production/.django-example
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,19 @@ SENDGRID_API_KEY=
NEW_RELIC_CONFIG_FILE=/app/config/newrelic.ini
NEW_RELIC_ENVIRONMENT=development
# NEW_RELIC_LICENSE_KEY= # overrides license_key in ini (preferred — keep key out of repo)
# NEW_RELIC_APP_NAME=AMI Backend (Demo)
# NEW_RELIC_MONITOR_MODE=true # set false to silence the agent without removing it
#
# REQUIRED per deploy — config/newrelic.ini intentionally does not set
# app_name. Examples (use the "Antenna Backend (<env>)" pattern for any
# new entity; the legacy "AMI Backend (Staging)" entity already exists
# in NR and can keep that name for history continuity if desired):
# NEW_RELIC_APP_NAME=Antenna Backend (live) # production
# NEW_RELIC_APP_NAME=Antenna Backend (Demo) # demo
# NEW_RELIC_APP_NAME=Antenna Backend (Staging) # staging (new entity)
# NEW_RELIC_APP_NAME=Antenna Backend (preview-N) # ephemeral preview stacks
# Missing → agent reports under the literal name "Python Application", which
# is an easy-to-spot orphan rather than a silent merge into another env.
NEW_RELIC_APP_NAME=Antenna Backend (development)
# NEW_RELIC_LOG_LEVEL=info # bump to debug only when reproducing an agent issue
# NEW_RELIC_HIGH_SECURITY=false # true forces obfuscated SQL + drops request params, irreversible per app
#
Expand Down
28 changes: 21 additions & 7 deletions config/newrelic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ license_key = a36747a6cc9bc083de03a9fb51dc4d32FFFFNRAL
# app names to group your aggregated data. For further details,
# please see:
# https://docs.newrelic.com/docs/apm/agents/manage-apm-agents/app-naming/use-multiple-names-app/
app_name = AMI Backend
#
# app_name is intentionally NOT set here. Each deploy supplies it via the
# NEW_RELIC_APP_NAME env var in .envs/.production/.django. The env var only
# wins if no [newrelic*] section in this file sets app_name — so leaving
# it unset here (and in every [newrelic:<env>] section below) is what
# makes env-var-driven naming work in agent 12.1.0.
#
# Missing env var → agent reports under the literal name "Python
# Application" (a recognizable orphan), not silently merged into another
# env's entity. This is the failure mode we want — visible misconfig,
# not silent data pollution.

# When "true", the agent collects performance data about your
# application and reports this data to the New Relic UI at
Expand Down Expand Up @@ -286,23 +296,27 @@ application_logging.metrics.enabled = true
#

[newrelic:development]
app_name = AMI Backend (Development)
# monitor_mode = true
monitor_mode = false

[newrelic:test]
monitor_mode = false

[newrelic:staging]
app_name = AMI Backend (Staging)
monitor_mode = true

[newrelic:production]
monitor_mode = true

# Per-env tuning lives in .envs/.production/.django (template:
# .envs/.production/.django-example). Common defaults in this file are
# production-safe; staging/demo opts into more aggressive tracing via
# NEW_RELIC_* env vars at deploy time.
# NOTE on app_name: per-env app_name is supplied via the NEW_RELIC_APP_NAME
# env var, not via a [newrelic:<env>] override here. None of the sections
# above set app_name, so the env var is free to define it at deploy time.
# This is what makes dynamic preview-stack deploys work without churning
# this file.
#
# Per-env tuning (sample rates, tracer thresholds, etc.) also lives in
# .envs/.production/.django (template: .envs/.production/.django-example).
# Common defaults in this file are production-safe; staging/demo opts into
# more aggressive tracing via NEW_RELIC_* env vars at deploy time.

# ---------------------------------------------------------------------------
Loading