This simple example demonstrates monitoring redis with the OpenTelemetry collector, using the redis receiver and sending the data to New Relic via OTLP.
- You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. Docker desktop includes a standalone Kubernetes server and client which is useful for local testing.
- A New Relic account
- A New Relic license key
-
Update the
NEW_RELIC_API_KEY
value in secrets.yaml to your New Relic license key.# ...omitted for brevity stringData: # New Relic API key to authenticate the export requests. # docs: https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key NEW_RELIC_API_KEY: <INSERT_API_KEY>
-
Note, be careful to avoid inadvertent secret sharing when modifying
secrets.yaml
. To ignore changes to this file from git, rungit update-index --skip-worktree k8s/secrets.yaml
. -
If your account is based in the EU, update the
NEW_RELIC_OTLP_ENDPOINT
value in collector.yaml the endpoint to: https://otlp.eu01.nr-data.net
# ...omitted for brevity env: # The default US endpoint is set here. You can change the endpoint and port based on your requirements if needed. # docs: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol - name: NEW_RELIC_OTLP_ENDPOINT value: https://otlp.eu01.nr-data.net
-
-
Run the application with the following command.
kubectl apply -f k8s/
- When finished, cleanup resources with the following command. This is also useful to reset if modifying configuration.
kubectl delete -f k8s/
To review your redis data in New Relic, navigate to "New Relic -> All Entities -> Redis instances" and click on the instance with name "redis" to view the instance summary. Click on "Metric explorer" to view all metrics associated with the redis instance, or use NRQL to perform ad-hoc analysis.
This example monitors a redis instance defined in redis.yaml, which is not receiving any load. To use in production, you'll need to modify the .receivers.redis.endpoint
value in collector.yaml ConfigMap to point to the endpoint of your redis instance. Additionally, update the server.address
and server.port
resource attributes defined in attributes/redis_metrics
to values which reflect the redis instance being monitored.