Skip to content

Commit 74a0f5e

Browse files
authored
Feat/monitoring (#1267) Cloud Version
* feat: add start monitoring remote servers * reafctor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: * refactor: add metrics * feat: add disk monitoring * refactor: translate to english * refacotor: add stats * refactor: remove color * feat: add log server metrics * refactor: remove unused deps * refactor: add origin * refactor: add logs * refactor: update * feat: add series monitoring * refactor: add system monitoring * feat: add benchmark to optimize data * refactor: update fn * refactor: remove comments * refactor: update * refactor: exclude items * feat: add refresh rate * feat: add monitoring remote servers * refactor: update * refactor: remove unsued volumes * refactor: update monitoring * refactor: add more presets * feat: add container metrics * feat: add docker monitoring * refactor: update conversion * refactor: remove unused code * refactor: update * refactor: add docker compose logs * refactor: add docker cli * refactor: add install curl * refactor: add get update * refactor: add monitoring remote servers * refactor: add containers config * feat: add container specification * refactor: update path * refactor: add server filter * refactor: simplify logic * fix: verify if file exist before get stats * refactor: update * refactor: remove unused deps * test: add test for containers * refactor: update * refactor add memory collector * refactor: update * refactor: update * refactor: update * refactor: remove * refactor: add memory * refactor: add server memory usage * refactor: change memory * refactor: update * refactor: update * refactor: add container metrics * refactor: comment code * refactor: mount proc bind * refactor: change interval with node cron * refactor: remove opening file * refactor: use streams * refactor: remove unused ws * refactor: disable live when is all * refactor: add sqlite * refactor: update * feat: add golang benchmark * refactor: update go * refactor: update dockerfile * refactor: update db * refactor: add env * refactor: separate logic * refactor: split logic * refactor: update logs * refactor: update dockerfile * refactor: hide .env * refactor: update * chore: hide ,.ebnv * refactor: add end angle * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update monitoring * refactor: add mount db * refactor: add metrics and url callback * refactor: add middleware * refactor: add threshold property * feat: add memory and cpu threshold notification * feat: send notifications to the server * feat: add metrics for dokploy server * refactor: add dokploy server to monitoring * refactor: update methods * refactor: add admin to useeffect * refactor: stop monitoring containers if elements are 0 * refactor: cancel request if appName is empty * refactor: reuse methods * chore; add feat monitoring * refactor: set base url * refactor: adjust monitoring * refactor: delete migrations * feat: add columns * fix: add missing flag * refactor: add free metrics * refactor: add paid monitoring * refactor: update methods * feat: improve ui * feat: add container stats * refactor: add all container metrics * refactor: add color primary * refactor: change default rate limiting refresher * refactor: update retention days * refactor: use json instead of individual properties * refactor: lint * refactor: pass json env * refactor: update * refactor: delete * refactor: update * refactor: fix types * refactor: add retention days * chore: add license * refactor: create db * refactor: update path * refactor: update setup * refactor: update * refactor: create files * refactor: update * refactor: delete * refactor: update * refactor: update token metrics * fix: typechecks * refactor: setup web server * refactor: update error handling and add monitoring * refactor: add local storage save * refactor: add spacing * refactor: update * refactor: upgrade drizzle * refactor: delete * refactor: uppgrade drizzle kit * refactor: update search with jsonB * chore: upgrade drizzle * chore: update packages * refactor: add missing type * refactor: add serverType * refactor: update url * refactor: update * refactor: update * refactor: hide monitoring on self hosted * refactor: update server * refactor: update * refactor: update * refactor: pin node version
1 parent 8c69d2a commit 74a0f5e

File tree

150 files changed

+36172
-11537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+36172
-11537
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build Docker images
22

33
on:
44
push:
5-
branches: ["canary", "main"]
5+
branches: ["canary", "main", "feat/monitoring"]
66

77
jobs:
88
build-and-push-cloud-image:
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
username: ${{ secrets.DOCKERHUB_USERNAME }}
1919
password: ${{ secrets.DOCKERHUB_TOKEN }}
20-
20+
2121
- name: Build and push Docker image
2222
uses: docker/build-push-action@v4
2323
with:
@@ -53,8 +53,7 @@ jobs:
5353
push: true
5454
tags: |
5555
siumauricio/schedule:${{ github.ref_name == 'main' && 'latest' || 'canary' }}
56-
platforms: linux/amd64
57-
56+
platforms: linux/amd64
5857

5958
build-and-push-server-image:
6059
runs-on: ubuntu-latest
@@ -77,4 +76,27 @@ jobs:
7776
push: true
7877
tags: |
7978
siumauricio/server:${{ github.ref_name == 'main' && 'latest' || 'canary' }}
80-
platforms: linux/amd64
79+
platforms: linux/amd64
80+
81+
build-and-push-monitoring-image:
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v3
87+
88+
- name: Log in to Docker Hub
89+
uses: docker/login-action@v2
90+
with:
91+
username: ${{ secrets.DOCKERHUB_USERNAME }}
92+
password: ${{ secrets.DOCKERHUB_TOKEN }}
93+
94+
- name: Build and push Docker image
95+
uses: docker/build-push-action@v4
96+
with:
97+
context: .
98+
file: ./Dockerfile.monitoring
99+
push: true
100+
tags: |
101+
siumauricio/monitoring:${{ github.ref_name == 'main' && 'latest' || 'canary' }}
102+
platforms: linux/amd64

.github/workflows/dokploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Dokploy Docker Build
22

33
on:
44
push:
5-
branches: [main, canary, feat/github-runners]
5+
branches: [main, canary, "feat/monitoring"]
66

77
env:
88
IMAGE_NAME: dokploy/dokploy

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ yarn-error.log*
3939
# Misc
4040
.DS_Store
4141
*.pem
42+
43+
44+
.db

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-slim AS base
1+
FROM node:20.9-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable

Dockerfile.cloud

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-slim AS base
1+
FROM node:20.9-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable

Dockerfile.monitoring

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Build stage
2+
FROM golang:1.21-alpine3.19 AS builder
3+
4+
# Instalar dependencias necesarias
5+
RUN apk add --no-cache gcc musl-dev sqlite-dev
6+
7+
# Establecer el directorio de trabajo
8+
WORKDIR /app
9+
10+
# Copiar todo el código fuente primero
11+
COPY . .
12+
13+
# Movernos al directorio de la aplicación golang
14+
WORKDIR /app/apps/monitoring
15+
16+
# Descargar dependencias
17+
RUN go mod download
18+
19+
# Compilar la aplicación
20+
RUN CGO_ENABLED=1 GOOS=linux go build -o main main.go
21+
22+
# Etapa final
23+
FROM alpine:3.19
24+
25+
# Instalar SQLite y otras dependencias necesarias
26+
RUN apk add --no-cache sqlite-libs docker-cli
27+
28+
WORKDIR /app
29+
30+
# Copiar el binario compilado y el archivo monitor.go
31+
COPY --from=builder /app/apps/monitoring/main ./main
32+
COPY --from=builder /app/apps/monitoring/main.go ./monitor.go
33+
34+
# COPY --from=builder /app/apps/golang/.env ./.env
35+
36+
# Exponer el puerto
37+
ENV PORT=3001
38+
EXPOSE 3001
39+
40+
# Ejecutar la aplicación
41+
CMD ["./main"]

Dockerfile.schedule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-slim AS base
1+
FROM node:20.9-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable

Dockerfile.server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-slim AS base
1+
FROM node:20.9-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable

apps/dokploy/__test__/traefik/server/update-server-config.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ import {
1414
import { beforeEach, expect, test, vi } from "vitest";
1515

1616
const baseAdmin: Admin = {
17+
enablePaidFeatures: false,
18+
metricsConfig: {
19+
containers: {
20+
refreshRate: 20,
21+
services: {
22+
include: [],
23+
exclude: [],
24+
},
25+
},
26+
server: {
27+
type: "Dokploy",
28+
cronJob: "",
29+
port: 4500,
30+
refreshRate: 20,
31+
retentionDays: 2,
32+
token: "",
33+
thresholds: {
34+
cpu: 0,
35+
memory: 0,
36+
},
37+
urlCallback: "",
38+
},
39+
},
1740
cleanupCacheApplications: false,
1841
cleanupCacheOnCompose: false,
1942
cleanupCacheOnPreviews: false,

apps/dokploy/components/dashboard/monitoring/docker/docker-block-chart.tsx renamed to apps/dokploy/components/dashboard/monitoring/free/container/docker-block-chart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Tooltip,
99
YAxis,
1010
} from "recharts";
11-
import type { DockerStatsJSON } from "./show";
11+
import type { DockerStatsJSON } from "./show-free-container-monitoring";
1212

1313
interface Props {
1414
acummulativeData: DockerStatsJSON["block"];

0 commit comments

Comments
 (0)