• 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 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. This integration includes the Kubernetes plugin for logs.

  2. Optionally, you can further tune your installation in the guided install using the numerous configuration options available in the newrelic-logging repository. However, we recommend the standard setup, as it's valid for most users.

    Go to one.newrelic.com > Integrations & Agents and click the Guided install tile. Then select Kubernetes and Guided.

    Important

    If you're using a Kubernetes secret to store the New Relic , 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?

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.

See Fluent Bit plugin for log forwarding for more details about it.

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.

    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.

  • Internal plugin metrics from newrelic-fluent-bit-output: 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're useful to assess the overall latency when delivering the logs to the New Relic Logs API or to observe potential packaging problems.

Troubleshoot your Kubernetes plugin for log forwarding installation

Sometimes, despite correctly installing the Kubernetes log forwarding plugin (newrelic-logging Helm chart), you may encounter performance issues that affect the correct delivery of logs. In that case, it can help to look at the log forwarder's internal metrics to see if you can find the cause of the problem.

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 display 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) with 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.

View log data

Once you have set everything up and collected the data, 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 you don't see any data after enabling 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 these steps. You do not need to do anything else in New Relic.

Choose your next step

Logs UI

Explore logging data across your platform with our logs UI

Logs in context

Get deeper visibility into both your application and your platform performance data by forwarding your logs with our logs in context capabilities

Alerts

Create alerts to stay informed about issues that matter most

Create dashboards

See how to gather and chart the specific data you want to see

Copyright © 2024 New Relic Inc.

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