This demo is meant to show how to connect your New Relic Observability Platform to a Varnish Enterprise Server.
If you don’t already have a New Relic account, sign up for a free account. You will need a license key from your New Relic account, which will be required in later steps.
systemd
Drop-InThe following step ensures that data is sent to New Relic via the varnish-otel service.
mkdir -p /etc/systemd/system/varnish-otel.service.d
cat << EOF > /etc/systemd/system/varnish-otel.service.d/newrelic.conf
[Service]
Environment=OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
Environment=OTEL_EXPORTER_OTLP_HEADERS=api-key=<license-key-value>
EOF
Replace <license-key-value>
with your INGEST - LICENSE
value from New Relic UI > Account > Administration > API Keys.
Make sure to restart the service after applying the configurations:
systemctl daemon-reload
systemctl restart varnish-otel.service
To test if everything is working, you can send some curl requests to localhost, and the results should appear in the New Relic UI as expected:
# this is only for testing so you can expect a 503 from Varnish
curl localhost:6081/this-is-a-test