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
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ services:
- defifundr-network
restart: on-failure

prometheus:
image: prom/prometheus:latest
container_name: defifundr-prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
depends_on:
- api
networks:
- defifundr-network

postgres:
image: postgres:15-alpine
container_name: defifundr-postgres
Expand Down Expand Up @@ -56,6 +68,19 @@ services:
networks:
- defifundr-network

grafana:
image: grafana/grafana:latest
container_name: defifundr-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-data:/var/lib/grafana
- ./grafana-provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana-provisioning/dashboards:/etc/grafana/provisioning/dashboards
depends_on:
- prometheus
prometheus:
image: prom/prometheus:latest
container_name: defifundr-prometheus
Expand All @@ -79,5 +104,7 @@ volumes:
driver: local
pgadmin-data:
driver: local
grafana-data:
driver: local
go-modules:
driver: local
39 changes: 39 additions & 0 deletions grafana-provisioning/dashboards/auth-metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": null,
"uid": "auth-metrics",
"title": "Authentication Metrics",
"tags": ["auth", "metrics"],
"timezone": "browser",
"schemaVersion": 36,
"version": 1,
"refresh": "10s",
"panels": [
{
"type": "stat",
"title": "Login Requests (Total)",
"gridPos": {"x": 0, "y": 0, "w": 8, "h": 4},
"targets": [
{
"expr": "sum(api_requests_total{path='/api/v1/auth/login'})",
"legendFormat": "Login Requests",
"refId": "A"
}
],
"options": {"reduceOptions": {"calcs": ["lastNotNull"]}},
"fieldConfig": {"defaults": {"unit": "short"}, "overrides": []}
},
{
"type": "graph",
"title": "Login Request Rate",
"gridPos": {"x": 8, "y": 0, "w": 16, "h": 8},
"targets": [
{
"expr": "rate(api_requests_total{path='/api/v1/auth/login'}[1m])",
"legendFormat": "Login Req/sec",
"refId": "A"
}
],
"fieldConfig": {"defaults": {"unit": "req/s"}, "overrides": []}
}
]
}
39 changes: 39 additions & 0 deletions grafana-provisioning/dashboards/business-metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": null,
"uid": "business-metrics",
"title": "Business Metrics",
"tags": ["business", "metrics"],
"timezone": "browser",
"schemaVersion": 36,
"version": 1,
"refresh": "10s",
"panels": [
{
"type": "stat",
"title": "Waitlist Signups (Total)",
"gridPos": {"x": 0, "y": 0, "w": 8, "h": 4},
"targets": [
{
"expr": "sum(waitlist_signups_total)",
"legendFormat": "Signups",
"refId": "A"
}
],
"options": {"reduceOptions": {"calcs": ["lastNotNull"]}},
"fieldConfig": {"defaults": {"unit": "short"}, "overrides": []}
},
{
"type": "graph",
"title": "Waitlist Signup Rate",
"gridPos": {"x": 8, "y": 0, "w": 16, "h": 8},
"targets": [
{
"expr": "rate(waitlist_signups_total[1m])",
"legendFormat": "Signups/sec",
"refId": "A"
}
],
"fieldConfig": {"defaults": {"unit": "1/s"}, "overrides": []}
}
]
}
11 changes: 11 additions & 0 deletions grafana-provisioning/dashboards/dashboard-provisioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1
providers:
- name: 'system-overview'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 30
options:
path: /etc/grafana/provisioning/dashboards
52 changes: 52 additions & 0 deletions grafana-provisioning/dashboards/system-overview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"id": null,
"uid": "system-overview",
"title": "System Overview",
"tags": ["system", "overview"],
"timezone": "browser",
"schemaVersion": 36,
"version": 1,
"refresh": "10s",
"panels": [
{
"type": "stat",
"title": "API Up",
"gridPos": {"x": 0, "y": 0, "w": 6, "h": 4},
"targets": [
{
"expr": "up{job=\"defifundr-api\"}",
"legendFormat": "API",
"refId": "A"
}
],
"options": {"reduceOptions": {"calcs": ["lastNotNull"]}},
"fieldConfig": {"defaults": {"unit": "none"}, "overrides": []}
},
{
"type": "graph",
"title": "API Request Rate",
"gridPos": {"x": 6, "y": 0, "w": 12, "h": 8},
"targets": [
{
"expr": "rate(api_requests_total[1m])",
"legendFormat": "Requests/sec",
"refId": "A"
}
],
"fieldConfig": {"defaults": {"unit": "req/s"}, "overrides": []}
},
{
"type": "graph",
"title": "Scrape Duration",
"gridPos": {"x": 0, "y": 8, "w": 12, "h": 8},
"targets": [
{
"expr": "scrape_duration_seconds{job=\"defifundr-api\"}",
"legendFormat": "Scrape Duration",
"refId": "A"
}
],
"fieldConfig": {"defaults": {"unit": "s"}, "overrides": []}
}
]
}
8 changes: 8 additions & 0 deletions grafana-provisioning/datasources/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
14 changes: 14 additions & 0 deletions grafana-provisioning/users/admin-user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: 1
users:
- name: "admin"
email: "admin@defifundr.com"
login: "admin"
password: "admin"
isGrafanaAdmin: true
isDisabled: false
- name: "observer"
email: "observer@defifundr.com"
login: "observer"
password: "observer"
isGrafanaAdmin: false
isDisabled: false
Loading