ddev-contrib
ddev-contrib copied to clipboard
Add recipe for New Relic, fixes #102
Fixes #102
I unfortunately tried this on a Drupal 9 project, so when I switched to PHP7.3 it failed. But then I tried on a D8 project, finally found some data that I didn't know how to use on Dashboards->Browser
Thanks for the review @rfay, I've got this on my list to update
Looking forward to seeing this get in @mglaman - thanks for the contribution!
I'm sure this will be useful to people, so hope you can return to it.
@mglaman you have lots to do, but please push this up to the top of your priority list and get it finished, thanks!
It's been more than a year @mglaman - maybe you can fit this in with your 20% if you get it!
@mglaman I would love to see this finished!
Het @mglaman, I know it's been a long time, maybe you can help us on how to configure this service, thank you very much in advance
Hello everyone, I have an example that is working decently, I'm not sure if it's the recommended way to do it. I have tried to follow the comments left by @rfay . I'm not an expert in Docker, so if you see any improvements, feel free to add them, and perhaps this recipe can become available.
docker-compose.newrelic.yaml
version: '3.6'
services:
newrelic:
image: newrelic/php-daemon
container_name: ddev-${DDEV_SITENAME}-newrelic
ports: ['31339']
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
web:
environment:
IMAGE_NAME: newrelic/php-daemon
NEW_RELIC_AGENT_VERSION: "9.2.0.247"
NEW_RELIC_LICENSE_KEY: "YOUR_API_KEY_HERE"
NEW_RELIC_APPNAME: ${DDEV_SITENAME}
NEW_RELIC_DAEMON_ADDRESS: "newrelic:31339"
links:
- newrelic:$DDEV_HOSTNAME
.ddev/php/newrelic.ini
[newrelic]
newrelic.license = "YOUR_API_KEY_HERE"
newrelic.appname = "THE_SAME_NAME_OF_NEW_RELIC_APPNAME_VAR"
newrelic.distributed_tracing_enabled = true
newrelic.transaction_tracer.enabled = true
newrelic.application_logging.enabled = true
newrelic.application_logging.metrics.enabled = true
newrelic.application_logging.forwarding.enabled = true
.ddev/web-build/Dockerfile.newrelic
FROM $BASE_IMAGE
ARG NEW_RELIC_AGENT_VERSION
ARG NEW_RELIC_LICENSE_KEY
ARG NEW_RELIC_APPNAME
RUN wget -O - https://download.newrelic.com/548C16BF.gpg | apt-key add - && \
sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt/sources.list.d/newrelic.list' && \
apt-get update
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install newrelic-php5
Run ddev restart
, browse your ddev site to generate some data.
Go to newrelic page, find APM & Services.
Example
@Gonzalo2683 you're doing great! Could you please create an add-on that implements this? It's super easy, and that's the maintainable way to handle these recipes.
- https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#creating-an-additional-service-for-ddev-get
- https://github.com/ddev/ddev-addon-template
I'm sure that after you do that (use a good README) then @tyler36 and I will be happy to try it out and offer suggestions/issues/PRs to your repo.
Is there a way to run this on Apple M2 ARM64? Any installation guide or commands would helpful, thanks.
It looks like newrelic does not provide an arm64 image, https://hub.docker.com/r/newrelic/php-daemon/tags, even 3+ years after arm64 has arrived.