• EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Esta tradução de máquina é fornecida para sua comodidade.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

Criar um problema

Plug-in Kubernetes para encaminhamento de logs

O plugin Kubernetes da New Relic para encaminhamento de logs simplifica o envio de logs do seu cluster para New Relic Logs. Ele usa uma imagem docker independente e é executado como um DaemonSet, coletando logs perfeitamente para análise centralizada e resolução de problemas. Encaminhar seus registros do Kubernetes para o New Relic fornecerá recursos aprimorados para coletar, processar, explorar, consultar e alertar sobre seus dados log .

Habilite o Kubernetes para gerenciamento de logs

Para encaminhar seu log do Kubernetes para o New Relic com nosso plug-in:

  1. Instale a integração do New Relic Kubernetes seguindo as etapas desta página. Essa integração inclui o plug-in Kubernetes para log.

  2. Opcionalmente, você pode ajustar ainda mais sua instalação na Etapa 4 da instalação guiada usando as inúmeras opções de configuração disponíveis no repositório newrelic-logging. Porém, recomendamos a configuração padrão, pois é válida para a maioria dos usuários.

    Importante

    Se você estiver usando um segredo Kubernetes para armazenar a chave de licença New Relic , o gráfico newrelic-logging usará como padrão o envio de log para os endpoints da API dos EUA. Se a chave de licença pertencer a uma conta UE ou FedRAMP e um segredo for usado para armazenamento de chaves, você deverá atualizar a configuração do endpoint com o valor apropriado nos documentos de referência da API. Aqui está um exemplo de como definir isso para contas da UE:

    newrelic-logging:
    enabled: true
    endpoint: https://log-api.eu.newrelic.com/log/v1
  3. Gere algum tráfego e aguarde alguns minutos e, em seguida, verifique os dados da sua conta .

Este documento ajudou você na instalação?

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. These are the recommended ones to troubleshoot a Kubernetes cluster because they can be faceted by cluster_name, node_name and hostname (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 do not contain dimensions, so they cannot be narrowed down to a particular cluster or host. Despite this, capturing them for a single cluster is 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.

Ver dados log

Se tudo estiver configurado corretamente e seus dados estiverem sendo coletados, você deverá ver os dados de log em ambos os locais:

SELECT * FROM Log

Se nenhum dado aparecer após você ativar nossos recursos de gerenciamento de logs, siga nossos procedimentos padrão de resolução de problemas de log.

Qual é o próximo?

Explore os dados de registro em sua plataforma com nossa interface de registros.

Desativar encaminhamento de logs

Para desativar os recursos de encaminhamento de logs, você pode desinstalar o plug-in Kubernetes seguindo as etapas descritas aqui. Você não precisa fazer mais nada no New Relic.

Copyright © 2024 New Relic Inc.

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