• EnglishEspañol日本語한국어Português
  • Log inStart now

Kubernetes plugin for log forwarding

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:

  1. Install the New Relic Kubernetes integration following the steps from this page. This integration includes the Kubernetes plugin for logs.

  2. 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: true
    endpoint: https://log-api.eu.newrelic.com/log/v1
  3. Generate some traffic and wait a few minutes, then check your account for data.

Did this doc help with your installation?

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:

  1. Install the Helm chart with the following extra configuration setting:
    newrelic-logging:
    fluentBit:
    sendMetrics: true
    You only need to enable the 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.
  2. 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.
  3. Import the resulting dashboard in JSON format by following these instructions.
  4. 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 and pod_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:

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.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.