The New Relic Kubernetes events integration watches for events happening in your Kubernetes clusters and sends those events to New Relic. Visualize your event data in the New Relic One platform through the Kubernetes cluster explorer or Infrastructure Events UI.
This feature is currently in beta.
By using this beta integration, you agree to the terms and conditions of New Relic’s pre-GA program. Your use of the beta integration is at your own risk. For additional information about this beta integration, please contact Martin Fuentes or JF Joly, Product Managers.
The Kubernetes events integration requires:
- New Relic Kubernetes integration installed and activated.
- Kubernetes pod with two containers, one used to capture events in the Kubernetes cluster and the other to forward the events to New Relic.
Install the Kubernetes events integration
To install the New Relic Kubernetes events integration in a Kubernetes environment:
Download the integration manifest YAML file:
curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/nri-kube-events-0.0.2.yaml
nri-kube-events-0.0.2.yamlmanifest file, adding both a cluster name, to identify your Kubernetes cluster (required), and your New Relic license key (required).
clusterName: "YOUR_CLUSTER_NAME" [...] - name: "NRIA_LICENSE_KEY" value: "YOUR_LICENSE_KEY"
Deploy the integration in your Kubernetes cluster:
kubectl apply -f nri-kube-events-0.0.2.yaml
To confirm that the integration has been configured correctly, wait a few minutes, then go to one.newrelic.com > Chart builder, and run the following NRQL query to see if data has been reported:
FROM Metric SELECT count(*) WHERE clusterName = 'YOUR_CLUSTER_NAME' since 1 hour ago
View and query your Kubernetes events
Once you have successfully installed the Kubernetes event integration, access your events with one of the following methods:
- Add events to your dashboards
To add events to your New Relic One Dashboard:
- Add a chart to a new or existing dashboard or create a chart using the chart builder.
When creating or updating your chart, select the chart type table and use the following event query, replacing YOUR_CLUSTER_NAME with the name of your cluster:
FROM InfrastructureEvent SELECT event.involvedObject.kind,event.involvedObject.name,event.reason,event.message WHERE clusterName = 'YOUR_CLUSTER_NAME' limit 100
- Query events with chart builder
Below are a few examples on querying your data with chart builder:
Get attributes names
To see all the attributes names, use the following query:
FROM InfrastructureEvents SELECT keyset() WHERE category = 'kubernetes'
See event details
To see details about the latest events in a cluster, use the following query, replacing YOUR_CLUSTER_NAME with the name of your cluster:
FROM InfrastructureEvent SELECT event.involvedObject.kind, event.involvedObject.name, event.type, event.message, event.reason WHERE category = 'kubernetes' AND clusterName=YOUR_CLUSTER_NAME
The events collected by New Relic will have the exact same attributes as given by Kubernetes. For a reference of these attributes please check the event v1 core reference in the official Kubernetes docs.
- Search events in New Relic Infrastructure
To search events in the New Relic Infrastructure UI:
- View events in the Kubernetes cluster explorer
To view events in the Kubernetes cluster explorer:
Access the Kubernetes cluster explorer using either of the two methods below:
- In the Kubernetes cluster explorer, select a pod to view the pod details.
- Select Show pod events.
Optional: Collect metrics for your events
If you would like to collect metric data for the events in your Kubernetes cluster, install the New Relic Prometheus OpenMetrics integration. To get started:
- Install the New Relic Prometheus OpenMetrics integration.
- Label the deployment of your Kubernetes events integration with your configured scrape label.
- By default, this is:
- By default, this is:
Here are some troubleshooting tips when using the Kubernetes events integration.
- Logs on event collection
To check the logs of our event collector:
kubectl logs deploy/nr-kube-events kube-events
To add more details, enable verbose mode by adding
verbose: "true"in the
configsection of you configuration file, either before or after the
- Logs on sending events
To check the logs of the agent responsible for sending the events to New Relic:
kubectl logs deploy/nr-kube-events infra-agent
For more help
Other Kubernetes integration resources: