Skip to content

Commit 73b36f5

Browse files
committed
add supervisor, monitoring
1 parent 7008323 commit 73b36f5

44 files changed

Lines changed: 676 additions & 203 deletions

Some content is hidden

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM python:3.10-slim
2-
RUN apt-get update && apt-get install -y procps
2+
RUN apt-get update && apt-get install -y procps git
33
LABEL authors="shift"
44
WORKDIR /app
55
COPY requirements.txt .

docker-compose.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- ./src:/app/src/
1111
stdin_open: true
1212
tty: true
13-
# entrypoint: "./entrypoint.sh"
13+
entrypoint: "/bin/bash" #"./entrypoint.sh"
1414
environment:
1515
- MLFLOW_TRACKING_URI=http://0.0.0.0:5001
1616
- HOST_DEPLOY = 0.0.0.0
@@ -35,8 +35,14 @@ services:
3535
- loki
3636
volumes:
3737
- grafana-storage:/var/lib/grafana
38+
- ./grafana/dashboards:/etc/grafana/dashboards
39+
- ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/tweet_dashboards.yml
40+
- ./grafana/datasources:/etc/grafana/provisioning/datasources
41+
- ./grafana/alerting:/etc/grafana/alerting
42+
- ./grafana/alerting.yml:/etc/grafana/provisioning/alerting/tweet_alerts.yml
3843
environment:
3944
- GF_SECURITY_ADMIN_PASSWORD=admin
45+
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/dashboards/tweet_dashboard.json
4046
restart: unless-stopped
4147

4248
loki:

grafana/alerting/rules.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
apiVersion: 1
2+
groups:
3+
- orgId: 1
4+
name: job alert
5+
folder: bert
6+
interval: 1m
7+
rules:
8+
- uid: dej6cljqgxekge
9+
title: Alert max jobs
10+
condition: C
11+
data:
12+
- refId: A
13+
relativeTimeRange:
14+
from: 600
15+
to: 0
16+
datasourceUid: cej41rlo2r11cd
17+
model:
18+
disableTextWrap: false
19+
editorMode: builder
20+
expr: prediction_status{model="bert"}
21+
fullMetaSearch: false
22+
includeNullMetadata: true
23+
instant: true
24+
intervalMs: 1000
25+
legendFormat: __auto
26+
maxDataPoints: 43200
27+
range: false
28+
refId: A
29+
useBackend: false
30+
- refId: C
31+
datasourceUid: __expr__
32+
model:
33+
conditions:
34+
- evaluator:
35+
params:
36+
- 5
37+
type: gt
38+
operator:
39+
type: and
40+
query:
41+
params:
42+
- C
43+
reducer:
44+
params: []
45+
type: last
46+
type: query
47+
datasource:
48+
type: __expr__
49+
uid: __expr__
50+
expression: A
51+
intervalMs: 1000
52+
maxDataPoints: 43200
53+
refId: C
54+
type: threshold
55+
noDataState: NoData
56+
execErrState: Error
57+
for: 1m
58+
annotations:
59+
description: Task is up to 5 jobs
60+
summary: Alert Sentiment analysis
61+
isPaused: false
62+
notification_settings:
63+
receiver: admin-email

grafana/alertings.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: 1
2+
3+
groups:
4+
- name: alert-rules
5+
folder: Tweet Alerts
6+
orgId: 1
7+
interval: 30s
8+
rules:
9+
- file: /etc/grafana/alerting/rules.yml

grafana/dashboards.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: "default"
5+
folder: "Tweet Dashboards"
6+
type: file
7+
options:
8+
path: /etc/grafana/dashboards

0 commit comments

Comments
 (0)