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

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

Caso haja alguma divergência entre a versão em inglês e a traduzida, a versão em inglês prevalece. Acesse esta página para mais informações.

Criar um problema

Instale e configure o NRDOT no Elasticsearch auto-hospedado

|View as Markdown (English)

Use este guia para instalar e configurar o NRDOT para monitorar um cluster Elasticsearch auto-hospedado em um servidor Linux ou VM. Uma vez configurado, o coletor exporta as métricas do seu cluster Elasticsearch para o New Relic. Para métricas de host, logs e tags personalizadas, consulte Configuração avançada.

Compatibilidade e requisitos

Suportado

  • Elasticsearch 7.16 ou posterior

Você precisa

Instalar o coletor NRDOT

Instale o coletor NRDOT e execute-o como um serviço systemd. Consulte Instalar o NRDOT.

Configure o coletor NRDOT

Atualize a configuração padrão do coletor para habilitar o monitoramento do Elasticsearch.

  1. Faça backup da configuração padrão do coletor e, em seguida, abra-o para edição:

    bash
    $
    sudo cp /etc/nrdot-collector/config.yaml /etc/nrdot-collector/config.yaml.backup
    $
    sudo nano /etc/nrdot-collector/config.yaml
  2. Exclua todo o conteúdo existente e substitua-o pela seguinte configuração para monitoramento do Elasticsearch.

    receivers:
    elasticsearch:
    endpoint: "http://<YOUR_ELASTICSEARCH_HOST>:9200"
    collection_interval: 15s
    metrics:
    elasticsearch.os.cpu.usage:
    enabled: true
    elasticsearch.cluster.data_nodes:
    enabled: true
    elasticsearch.cluster.health:
    enabled: true
    elasticsearch.cluster.in_flight_fetch:
    enabled: true
    elasticsearch.cluster.nodes:
    enabled: true
    elasticsearch.cluster.pending_tasks:
    enabled: true
    elasticsearch.cluster.shards:
    enabled: true
    elasticsearch.cluster.state_update.time:
    enabled: true
    elasticsearch.index.documents:
    enabled: true
    elasticsearch.index.operations.merge.current:
    enabled: true
    elasticsearch.index.operations.time:
    enabled: true
    elasticsearch.node.cache.count:
    enabled: true
    elasticsearch.node.cache.evictions:
    enabled: true
    elasticsearch.node.cache.memory.usage:
    enabled: true
    elasticsearch.node.shards.size:
    enabled: true
    elasticsearch.node.cluster.io:
    enabled: true
    elasticsearch.node.documents:
    enabled: true
    elasticsearch.node.disk.io.read:
    enabled: true
    elasticsearch.node.disk.io.write:
    enabled: true
    elasticsearch.node.fs.disk.available:
    enabled: true
    elasticsearch.node.fs.disk.total:
    enabled: true
    elasticsearch.node.http.connections:
    enabled: true
    elasticsearch.node.ingest.documents.current:
    enabled: true
    elasticsearch.node.ingest.operations.failed:
    enabled: true
    elasticsearch.node.open_files:
    enabled: true
    elasticsearch.node.operations.completed:
    enabled: true
    elasticsearch.node.operations.current:
    enabled: true
    elasticsearch.node.operations.get.completed:
    enabled: true
    elasticsearch.node.operations.time:
    enabled: true
    elasticsearch.node.shards.reserved.size:
    enabled: true
    elasticsearch.index.shards.size:
    enabled: true
    elasticsearch.os.cpu.load_avg.1m:
    enabled: true
    elasticsearch.os.cpu.load_avg.5m:
    enabled: true
    elasticsearch.os.cpu.load_avg.15m:
    enabled: true
    elasticsearch.os.memory:
    enabled: true
    jvm.gc.collections.count:
    enabled: true
    jvm.gc.collections.elapsed:
    enabled: true
    jvm.memory.heap.max:
    enabled: true
    jvm.memory.heap.used:
    enabled: true
    jvm.memory.heap.utilization:
    enabled: true
    jvm.threads.count:
    enabled: true
    elasticsearch.index.segments.count:
    enabled: true
    elasticsearch.index.operations.completed:
    enabled: true
    elasticsearch.node.script.cache_evictions:
    enabled: false
    elasticsearch.node.cluster.connections:
    enabled: false
    elasticsearch.node.pipeline.ingest.documents.preprocessed:
    enabled: false
    elasticsearch.node.thread_pool.tasks.queued:
    enabled: false
    elasticsearch.cluster.published_states.full:
    enabled: false
    jvm.memory.pool.max:
    enabled: false
    elasticsearch.node.script.compilation_limit_triggered:
    enabled: false
    elasticsearch.node.shards.data_set.size:
    enabled: false
    elasticsearch.node.pipeline.ingest.documents.current:
    enabled: false
    elasticsearch.cluster.state_update.count:
    enabled: false
    elasticsearch.node.fs.disk.free:
    enabled: false
    jvm.memory.nonheap.used:
    enabled: false
    jvm.memory.pool.used:
    enabled: false
    elasticsearch.node.translog.size:
    enabled: false
    elasticsearch.node.thread_pool.threads:
    enabled: false
    elasticsearch.cluster.state_queue:
    enabled: false
    elasticsearch.node.translog.operations:
    enabled: false
    elasticsearch.memory.indexing_pressure:
    enabled: false
    elasticsearch.node.ingest.documents:
    enabled: false
    jvm.classes.loaded:
    enabled: false
    jvm.memory.heap.committed:
    enabled: false
    elasticsearch.breaker.memory.limit:
    enabled: false
    elasticsearch.indexing_pressure.memory.total.replica_rejections:
    enabled: false
    elasticsearch.breaker.memory.estimated:
    enabled: false
    elasticsearch.cluster.published_states.differences:
    enabled: false
    jvm.memory.nonheap.committed:
    enabled: false
    elasticsearch.node.translog.uncommitted.size:
    enabled: false
    elasticsearch.node.script.compilations:
    enabled: false
    elasticsearch.node.pipeline.ingest.operations.failed:
    enabled: false
    elasticsearch.indexing_pressure.memory.limit:
    enabled: false
    elasticsearch.breaker.tripped:
    enabled: false
    elasticsearch.indexing_pressure.memory.total.primary_rejections:
    enabled: false
    elasticsearch.node.thread_pool.tasks.finished:
    enabled: false
    processors:
    memory_limiter:
    check_interval: 60s
    limit_mib: ${env:NEW_RELIC_MEMORY_LIMIT_MIB:-100}
    cumulativetodelta: {}
    attributes/cluster_state_aggregate:
    include:
    match_type: strict
    metric_names:
    - elasticsearch.cluster.state_update.time
    actions:
    - key: type
    action: delete
    - key: state
    action: delete
    filter/critical_operations:
    metrics:
    datapoint:
    # Filters to keep only: query, index, get, merge
    # Affects only 4 metrics: *.operations.completed and *.operations.time
    # All other metrics pass through unchanged
    - 'attributes["operation"] == "query" or attributes["operation"] == "index" or attributes["operation"] == "get" or attributes["operation"] == "merge" or attributes["operation"] == nil'
    resource/cluster_name_override:
    attributes:
    - key: elasticsearch.cluster.name
    value: "<YOUR_ELASTICSEARCH_CLUSTER_NAME>"
    action: upsert
    resourcedetection:
    detectors: [ system ]
    system:
    resource_attributes:
    host.name:
    enabled: true
    host.id:
    enabled: true
    os.type:
    enabled: true
    batch:
    timeout: 30s
    send_batch_size: 2048
    send_batch_max_size: 4096
    attributes/cardinality_reduction:
    actions:
    - key: process.pid
    action: delete
    - key: process.parent_pid
    action: delete
    transform/metadata_nullify:
    metric_statements:
    - context: metric
    statements:
    - set(description, "")
    - set(unit, "")
    exporters:
    otlphttp:
    endpoint: ${env:NEWRELIC_OTLP_ENDPOINT}
    headers:
    api-key: ${env:NEWRELIC_LICENSE_KEY}
    compression: gzip
    timeout: 30s
    retry_on_failure:
    enabled: true
    initial_interval: 5s
    max_interval: 30s
    max_elapsed_time: 300s
    service:
    pipelines:
    metrics/elasticsearch:
    receivers: [elasticsearch]
    processors: [memory_limiter, resourcedetection, resource/cluster_name_override, attributes/cardinality_reduction, filter/critical_operations, attributes/cluster_state_aggregate, cumulativetodelta, transform/metadata_nullify, batch]
    exporters: [otlphttp]

Parâmetro de configuração

A tabela a seguir descreve os principais parâmetros de configuração usados na configuração acima:

ParâmetroDescrição
endpointA URL do seu cluster Elasticsearch.
collection_intervalO intervalo entre as coletas de métrica. O padrão é 15s.
elasticsearch.cluster.nameUm nome exclusivo que identifica este cluster no New Relic.
NEW_RELIC_MEMORY_LIMIT_MIBO limite de memória, em MiB, para o processador memory_limiter do coletor, definido para se adequar ao seu ambiente.
NEWRELIC_LICENSE_KEYSua chave de licença New Relic.
NEWRELIC_OTLP_ENDPOINTO endpoint OTLP da New Relic para a região da sua conta, conforme os endpoints OTLP da New Relic.
  1. Salve o arquivo de configuração.

Você pode, opcionalmente, adicionar autenticação de cluster seguro, métricas de host, coleta de logs ou tags de metadados personalizadas. Consulte a Configuração avançada.

Defina as variáveis de ambiente

Defina as credenciais e os detalhes de conexão que o coletor precisa para enviar dados para o New Relic.

bash
$
sudo mkdir -p /etc/systemd/system/nrdot-collector.service.d
$
cat <<EOF | sudo tee /etc/systemd/system/nrdot-collector.service.d/environment.conf
$
[Service]
$
Environment="NEWRELIC_OTLP_ENDPOINT=<YOUR_NEWRELIC_OTLP_ENDPOINT>"
$
Environment="NEWRELIC_LICENSE_KEY=<YOUR_NEWRELIC_LICENSE_KEY>"
$
Environment="NEW_RELIC_MEMORY_LIMIT_MIB=100"
$
EOF

Reinicie o coletor NRDOT

Reinicie o coletor para aplicar suas alterações:

bash
$
sudo systemctl daemon-reload
$
sudo systemctl restart nrdot-collector.service

Verificar coleta de dados

Em até -5 minutos após reiniciar o coletor, execute esta consulta no New Relic para confirmar que os dados estão fluindo (substitua <YOUR_ELASTICSEARCH_CLUSTER_NAME> pelo nome do seu cluster):

FROM Metric SELECT count(*)
WHERE metricName LIKE 'elasticsearch.%'
AND elasticsearch.cluster.name = '<YOUR_ELASTICSEARCH_CLUSTER_NAME>'
SINCE 10 minutes ago

Dica

Você também pode verificar o próprio coletor: nrdot-collector.service deve relatar active (running) (sudo systemctl status nrdot-collector.service), sem erros de conexão nos logs (sudo journalctl -u nrdot-collector.service -f).

Se você não visualizar dados em cerca de 5 minutos, consulte a resolução de problemas do Elasticsearch.

Encontre e use seus dados

Assim que o New Relic coletar seus dados, você poderá acessar o monitoramento do Elasticsearch pela interface do New Relic.

Para encontrar seu dashboard do Elasticsearch no New Relic:

  1. Vá para one.newrelic.com > Integrations & Agents.
  2. Na aba All, clique em Dashboards e, em seguida, pesquise por Elasticsearch (OpenTelemetry Collector) para visualizar o dashboard.

Ou, na navegação à esquerda:

  1. Clique em Dashboards.
  2. Pesquise o dashboard Elasticsearch (OpenTelemetry Collector) para visualizá-lo.

Após configurar o monitoramento do Elasticsearch com o NRDOT, você pode:

Dica

Correlacione APM com Elasticsearch: Para conectar seu aplicativo APM e o cluster Elasticsearch, inclua o atributo de recurso es.cluster.name="your-cluster-name" em suas métricas APM. Isso permite que você visualize dados do APM e do Elasticsearch juntos no New Relic.

Copyright © 2026 New Relic Inc.

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