Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Iac observability stack (Jaeger, Prometheus, Alertmanager, Grafana and Loki and Configuration Kind Cluster #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mmacanmunhoz
Copy link

@mmacanmunhoz mmacanmunhoz commented Dec 26, 2024

Added docker-compose.yml file with configuration for:

  • Jaeger (distributed tracing)
  • Prometheus (metrics collection)
  • Alertmanager (alert management)
  • Grafana (metrics and log visualization)
  • Loki (log storage)
  • Added persistent volumes for relevant services.
  • Initial configuration for all services with ports exposed for easy access.
  • Suggested infra/docker directory for custom files like prometheus.yml and loki-config.yml.
  • Add Kind Manifest and Instruction to Install

@mmacanmunhoz mmacanmunhoz changed the title feat(api): Add docker-compose file with observability stack (Jaeger, Prometheus, Alertmanager, Grafana and Loki) feat(api): Add Iac observability stack (Jaeger, Prometheus, Alertmanager, Grafana and Loki and Configuration Kind Cluster Dec 26, 2024
@mmacanmunhoz mmacanmunhoz changed the title feat(api): Add Iac observability stack (Jaeger, Prometheus, Alertmanager, Grafana and Loki and Configuration Kind Cluster feat: Add Iac observability stack (Jaeger, Prometheus, Alertmanager, Grafana and Loki and Configuration Kind Cluster Dec 26, 2024
**Portas Explicadas:**
- `3000`: Interface web do Grafana para criação de dashboards e visualização de dados.

**Ambiente Configurado:**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que podemos utiliza a env no dockerfile para habilitar o login anonimo do Grafana. Isso evita pequenas confusões para os usuários.

GF_AUTH_ANONYMOUS_ENABLED=true

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ótima sugestão


## Volumes Persistentes

Os seguintes volumes são utilizados para armazenar dados de forma persistente:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por se tratar de um ambiente de teste, acha necessário persistir dados?

Copy link
Author

@mmacanmunhoz mmacanmunhoz Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eu acho relevante os seguintes pontos para um ambiente local:

  • Testes que dependem de dados históricos: Se você precisa testar comportamentos baseados em dados armazenados anteriormente, a persistência é necessária (importante no contexto de logs, métricas e afins).
  • Validação de integridade de dados: Testar se a aplicação mantém a integridade dos dados após reinicializações ou falhas requer volumes persistentes.

Dado a esses pontos e a capacidade simplista de remover volumes do docker (docker volume prune -f), não vejo o motivo do porque "não manter" volumes persistentes pré definidos, e a facilidade de remoção desses volumes no manifesto do docker compose caso não deseje é simples, porém para atender o ponto que você trouxe e a minha observação, podemos manter as seguintes opções (minha percepção)

  • Manter um documento de como mapear volumes persistentes ou manter um documento de como remover volumes persistentes.

Acho que ambos são validos e englobaria ambos os cenários e traria facilidade para quem for utilizar


## Como Utilizar

1. Certifique-se de ter o Docker e Docker Compose instalados em sua máquina.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acha interessante adicionar um tópico de pré-requisitos com os links de instalação do docker e docker-compose?
Ex.

### Pré-Requisitos:

[Docker](https://docs.docker.com/get-docker/)
[Docker Compose](https://docs.docker.com/compose/install/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugiro também colocar os links das documentações de todas as ferramentas utilizadas, através de um tópico de Referências.
Ex:

Referências:

[Docker] (https://docs.docker.com/manuals/)
[Docker Compose] (https://docs.docker.com/compose/)
[Grafana] (https://grafana.com/docs/grafana/latest/)
[Jaeger] (https://www.jaegertracing.io/docs/2.2/)
[Prometheus] (https://prometheus.io/docs/prometheus/latest/configuration/configuration/)
[Loki] (https://grafana.com/docs/loki/latest/)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode fazer sentido sim !!

git clone [email protected]:dosedetelemetria/projeto-otel-na-pratica.git
cd iac
```
3. Suba os serviços com o comando:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Suba os serviços com o comando:
3. Inicie os serviços com o comando:


## Finalidade de Cada Serviço

- **Jaeger:** Rastreamento distribuído.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugestão você pode migrar esse bloco com as descrições para tópico 4,

Suggested change
- **Jaeger:** Rastreamento distribuído.
- [Jaeger:](http://localhost:16686) Rastreamento distribuído.

- "9093:9093"
command:
- "--config.file=/etc/alertmanager/alertmanager.yml"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aqui tem uma linha a mais.

Suggested change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Podemos contribuir com um pré commit que faça lint nos arquivos para melhorar espaçamentos e comentários

Comment on lines +42 to +43
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validar antes.

Suggested change
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED=true


## Como Utilizar

1. Certifique-se de ter o Docker e Docker Compose instalados em sua máquina.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugiro também colocar os links das documentações de todas as ferramentas utilizadas, através de um tópico de Referências.
Ex:

Referências:

[Docker] (https://docs.docker.com/manuals/)
[Docker Compose] (https://docs.docker.com/compose/)
[Grafana] (https://grafana.com/docs/grafana/latest/)
[Jaeger] (https://www.jaegertracing.io/docs/2.2/)
[Prometheus] (https://prometheus.io/docs/prometheus/latest/configuration/configuration/)
[Loki] (https://grafana.com/docs/loki/latest/)


Este repositório contém uma stack completa de ferramentas de observabilidade, configurada utilizando o Docker Compose (versão 3.9). Abaixo estão os serviços incluídos e suas respectivas funcionalidades.

## Serviços Disponíveis

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para quem tiver interesse em estudar outras ferramentas, poderia ser interessante utilizar os serviços da Grafana Stack (Loki, Tempo e Mimir).

Pretendo criar os arquivos de configuração para essa stack sugerida e abro um PR posteriormente.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho uma boa opção dar visão a mais ferramentas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alguem motivo para remover os manifestos ?

Copy link
Author

@mmacanmunhoz mmacanmunhoz Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aloisiobilck eu sugeri uma outra estrutura de pastas, dividindo na pasta docker e k8s, então o README fica dentro do seu respectivo contexto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants