Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
585 changes: 210 additions & 375 deletions .github/workflows/homologacao.yml

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@
LABEL org.opencontainers.image.revision="${GIT_COMMIT}"
LABEL org.opencontainers.image.vendor="Help-Me Team"

# Instalar dependências do sistema
# hadolint ignore=DL3018
# DL3018: Pinar versões de pacotes Alpine quebra builds quando o repositório
# atualiza por patches de segurança. A imagem base node:20-alpine já é
# atualizada regularmente com correções de segurança.
RUN apk add --no-cache \

Check failure on line 73 in api/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker Image

DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
dumb-init \
openssl \
curl \
&& rm -rf /var/cache/apk/*
curl

# Habilitar pnpm via corepack no stage de produção
RUN corepack enable && corepack prepare pnpm@latest --activate
Expand Down Expand Up @@ -122,4 +124,4 @@
ENTRYPOINT ["dumb-init", "--"]

# Comando para iniciar a aplicação
CMD ["node", "dist/server.cjs"]
CMD ["node", "dist/server.cjs"]
50 changes: 49 additions & 1 deletion api/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,49 @@ services:
- "com.helpme.service=monitoring"
- "com.helpme.monitoring.type=log-collector"

# ============================================
# MONITORAMENTO - Tempo (Tracing)
# ============================================
tempo_helpme:
image: grafana/tempo:2.4.0
container_name: tempo_helpme
hostname: tempo_helpme
environment:
TZ: America/Sao_Paulo
command: ["-config.file=/etc/tempo.yaml"]
ports:
- "${TEMPO_PORT:-3200}:3200" # HTTP API
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
volumes:
- ./painel-analitico/monitoring/tempo.yaml:/etc/tempo.yaml:ro
- tempo_data:/tmp/tempo
networks:
- helpme_network
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3200/ready || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
labels:
- "com.helpme.service=monitoring"
- "com.helpme.monitoring.type=tracing"

# ============================================
# MONITORAMENTO - Grafana
# ============================================
Expand Down Expand Up @@ -476,6 +519,7 @@ services:
- influxdb_helpme
- postgresql_helpme
- loki_helpme
- tempo_helpme
deploy:
resources:
limits:
Expand Down Expand Up @@ -1027,8 +1071,8 @@ services:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper_helpme_teste:2182'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka_helpme_teste:9092,PLAINTEXT_HOST://localhost:9094
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,PLAINTEXT_HOST://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka_helpme_teste:9092,PLAINTEXT_HOST://localhost:9095
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
Expand Down Expand Up @@ -1167,6 +1211,10 @@ volumes:
driver: local
name: prometheus_helpme_data

tempo_data:
driver: local
name: tempo_helpme_data

postgresql_data_teste:
driver: local
name: postgresql_helpme_data_teste
Expand Down
12 changes: 10 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "help-me-api",
"version": "1.2.1",
"version": "1.2.5",
"description": "API para help desk",
"main": "index.js",
"type": "module",
Expand All @@ -11,7 +11,7 @@
"url": "https://github.com/diego64/help-me.git"
},
"scripts": {
"dev": "tsx watch --env-file=.env src/server.ts",
"dev": "tsx watch --env-file=.env --import src/server.ts",
"build": "tsup",
"start": "node --env-file=.env dist/server.js",
"generate": "dotenv -e .env -- prisma generate",
Expand Down Expand Up @@ -43,6 +43,14 @@
"packageManager": "pnpm@10.28.1",
"dependencies": {
"@influxdata/influxdb-client": "^1.35.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/auto-instrumentations-node": "0.57.0",
"@opentelemetry/core": "^2.6.0",
"@opentelemetry/exporter-trace-otlp-http": "0.57.0",
"@opentelemetry/resources": "1.30.0",
"@opentelemetry/sdk-node": "0.57.0",
"@opentelemetry/sdk-trace-base": "1.30.0",
"@opentelemetry/semantic-conventions": "1.30.0",
"@prisma/adapter-pg": "^7.4.1",
"@prisma/client": "7.3.0",
"compression": "^1.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
"refresh": "5s",
"schemaVersion": 39,
"tags": [
"logs"

],
"templating": {
"list": [
Expand Down Expand Up @@ -599,7 +599,7 @@
},
"timepicker": {},
"timezone": "America/Sao_Paulo",
"title": "logs-aplicacao",
"title": "aplicacao",
"uid": "logs-v1",
"version": 3,
"weekStart": ""
Expand Down
Loading
Loading