Skip to content

Commit

Permalink
Allow use of external NewRelic daemon [sc-176579]
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislrobinson committed Jan 22, 2025
1 parent 6295285 commit c21183e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ RUN set -e \
&& addgroup --gid 1085 nginx \
&& adduser --system --shell /bin/false --no-create-home --disabled-password --uid 1085 --gid 1085 nginx \
# initialize dirs and owners
&& mkdir -p /var/log/nginx /var/log/php /var/log/deskpro /var/log/supervisor /var/lib/vector \
&& mkdir -p /var/log/nginx /var/log/php /var/log/deskpro /var/log/supervisor /var/lib/vector /var/log/newrelic \
&& mkdir -p /srv/deskpro/INSTANCE_DATA/deskpro-config.d \
&& chown root:root /usr/local/bin/vector \
&& chown vector:adm /var/lib/vector \
&& chown nginx:adm /var/log/nginx \
&& chown dp_app:adm /var/log/php /var/log/deskpro \
&& chmod -R 0775 /var/log/php /var/log/deskpro \
&& chown dp_app:adm /var/log/php /var/log/deskpro /var/log/newrelic \
&& chmod -R 0775 /var/log/php /var/log/deskpro /var/log/newrelic \
# set group sticky bit on these dirs so
# new logs get created with adm group (so vector can read them)
&& chmod g+s /var/log/nginx /var/log/php /var/log/deskpro \
&& chmod g+s /var/log/nginx /var/log/php /var/log/deskpro /var/log/newrelic \
# extract var names from our reference list
# (these lists are used from various helper scripts or entrypoint scripts)
&& jq -r '.[] | select(.isPrivate|not) | .name' /usr/local/share/deskpro/container-var-reference.json > /usr/local/share/deskpro/container-public-var-list \
Expand Down
3 changes: 3 additions & 0 deletions etc/php/8.3/mods-available/newrelic.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ newrelic.logfile = "/var/log/newrelic/php_agent.log"
newrelic.appname = {{ getenv "DESKPRO_NR_APP_NAME" "Deskpro" | quote }}
newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
newrelic.daemon.location = "/usr/local/bin/newrelic-daemon"
{{if getenv "DESKPRO_NR_DAEMON_ADDRESS"}}
newrelic.daemon.address = {{ getenv "DESKPRO_NR_DAEMON_ADDRESS" "" | quote }}
{{end}}
{{else}}
# To enable newrelic extension, set DESKPRO_ENABLE_NEWRELIC=true
# extension = "newrelic.so"
Expand Down
6 changes: 6 additions & 0 deletions usr/local/share/deskpro/container-var-reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@
"type": "string",
"default": "Deskpro"
},
{
"name": "DESKPRO_NR_DAEMON_ADDRESS",
"description": "Network address of an external NewRelic proxy daemon to use instead of the internal one.",
"type": "string",
"example": "1.2.3.4:31339"
},
{
"name": "DESKPRO_NR_LICENSE",
"description": "License key for NewRelic integration.",
Expand Down

0 comments on commit c21183e

Please sign in to comment.