New Relic's Kubernetes plugin for log forwarding simplifies sending logs from your cluster to New Relic logs. It uses a standalone Docker image and runs as a DaemonSet, seamlessly collecting logs for centralized analysis and troubleshooting. Forwarding your Kubernetes logs to New Relic will give you enhanced l capabilities to collect, process, explore, query, and alert on your log data.
Enable Kubernetes for log management
To forward your Kubernetes logs to New Relic with our plugin:
Install the New Relic Kubernetes integration following the steps from this page. This integration includes the Kubernetes plugin for logs.
Optionally, you can further tune your installation in Step 4 from the guided install using the numerous configuration options available in the newrelic-logging repository. However, we recommend the standard setup, as it is valid for most users.
Important
If you're using a Kubernetes secret to store the New Relic license key, the
newrelic-logging
chart defaults to sending logs to the US API endpoint. If the license key belongs to an EU or FedRAMP account, and a secret is used for key storage, you must update the endpoint setting with the appropriate value from the API reference docs. Here's an example of how to set this for EU accounts:newrelic-logging:enabled: trueendpoint: https://log-api.eu.newrelic.com/log/v1Generate some traffic and wait a few minutes, then check your account for data.
Did this doc help with your installation?
Install Fluent Bit output plugin
New Relic has a Fluent Bit output plugin to forward your logs to New Relic log management. This plugin is also provided in a standalone Docker image that can be installed in a Kubernetes cluster in the form of a DaemonSet, also known as the Kubernetes plugin.
You can install it in your cluster using our Helm chart in two ways.
Use our guided install
Although the newrelic-logging chart works as a standalone, we recommend installing it as part of the nri-bundle chart.
The best way to install this is through our guided installation process. This guided install can generate the Helm 3 commands required to install it (see "Helm 3").
Manual installation
Alternately, you can install it manually using Helm, by running this command to install the repo:
$helm repo add newrelic https://helm-charts.newrelic.com
To update the repo you can run:
$helm repo update newrelic
Go here for uninstallation instructions.
Troubleshoot your Kubernetes plugin for log forwarding installation
Sometimes, despite correctly installing the Kubernetes plugin for log forwarding (newrelic-logging
Helm chart), you may encounter performance issues that affect the correct delivery of logs. In such circumstances, looking at the log forwarder internal metrics can be helpful to understand the cause of a potential bottleneck.
The newrelic-logging
Helm chart provides a configuration setting to enable the collection of such metrics for a given Kubernetes cluster. We also provide a JSON-formatted dashboard template to easily display all these metrics in New Relic.
To configure your Kubernetes cluster to send the log forwarder internal metrics and represent them in a dashboard, follow these steps:
- Install the Helm chart with the following extra configuration setting:You only need to enable thenewrelic-logging:fluentBit:sendMetrics: true
newrelic-logging.fluentBit.sendMetrics
setting when troubleshooting a Kubernetes cluster. We recommend enabling it for a single Kubernetes cluster at a time to ease troubleshooting. - Download this dashboard template file. Open it in a text editor and replace all the
YOUR_ACCOUNT_ID
occurrences (49 in total) by your New Relic Account ID. - Import the resulting dashboard in JSON format by following these instructions.
- The imported dashboard will be available in your Dashboards page as
Kubernetes Fluent Bit monitoring
.
Additional metric details
The newrelic-logging
Helm chart uses Fluent Bit together with New Relic's newrelic-fluent-bit-output plugin to send logs to New Relic. The fluentBit.sendMetrics
configuration option enables the collection of their individual metrics:
- Fluent Bit internal metrics: emitted by Fluent Bit in Prometheus format and delivered to New Relic's Prometheus Export endpoint. They can be faceted by
cluster_name
,node_name
andpod_name
. - newrelic-fluent-bit-output's internal plugin metrics: collected by the output plugin and sent to New Relic's Metric API. These metrics only contain the
cluster_name
dimension, so they can be narrowed down to a particular cluster but not to a particular host or pod. They are useful to assess the overall latency when delivering the logs to the New Relic Logs API or to observe potential packaging problems.
We capture Fluent Bit's internal metrics by using its prometheus_scrape INPUT plugin in conjunction with its prometheus_remote_write OUTPUT plugin. All the Prometheus counter
metrics are actually cumulative counters, but we automatically perform a delta conversion when they are ingested at New Relic to ease querying them using NRQL later. You can find more details here.
View log data
If everything is configured correctly and your data is being collected, you should see log data in both of these places:
- Our logs UI
- Our tools for running NRQL queries. For example, you can execute a query like this:
SELECT * FROM Log
If no data appears after you enable our log management capabilities, follow our standard log troubleshooting procedures.
Disable log forwarding
To disable log forwarding capabilities, you can uninstall the Kubernetes plugin by following the steps outlined here. You do not need to do anything else in New Relic.
What's next?
Explore logging data across your platform with our logs UI.
- Get deeper visibility into both your application and your platform performance data by forwarding your logs with our logs in context capabilities.
- Set up alerts.
- Query your data and create dashboards.