GithubHelp home page GithubHelp logo

solucao-prometheus's Introduction

Solução-prometheus

Criando um ambiente de monitonamento com Prometheus e Grafana

Criando o serviço Prometheus pelo Docker

1. Crie um diretório para armazenar os arquivos de configuração e dados do Prometheus.

(diretório sugerido: /opt/containerd )

mkdir /opt/containerd/prometheus
cd /opt/containerd/prometheus

2. Crie um arquivo de configuração do Prometheus chamado prometheus.yml,

a) Para incluir uma máquina virtual como um alvo de coleta do Prometheus é preciso declara o IP dela no arquivo prometheus.yml da seguinte forma:

global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'node_exporter'
    static_configs:
      - targets: ['192.168.10.1:9100']

b) Este arquivo de configuração configura o Prometheus para coletar métricas de si mesmo e da máquina com IP 192.168.10.1, a qual queremos, por exemplo, observar.:

'targets: ['localhost:9090']' Mapeia a porta 9090 do host para a porta 9090 do container

3. Inicie o Prometheus usando o Docker com o seguinte comando:

Certifique-se de substituir o caminho "opt/containerd/prometheus/" pelo caminho real para o diretório que você criou no Passo 1.

docker run -d -p 9090:9090 \
 --name prometheus \
 -v /opt/containerd/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
 prom/prometheus
  1. O Prometheus está acessível na URL: http://IP-do-host:9090

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.