papri-ka commited on
Commit
ec82763
·
1 Parent(s): 9adba68

Deploy promethetus server

Browse files
Files changed (2) hide show
  1. Dockerfile +21 -0
  2. turing_cloud.yml +41 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM prom/prometheus:latest
2
+
3
+ # Create a non-root user to run the application and set permissions
4
+ RUN useradd -m -u 1000 turinguser
5
+
6
+ # Create directories and set permissions
7
+ RUN mkdir -p /app/models && chown -R turinguser:turinguser /app /app/models
8
+
9
+ # Switch to the non-root user
10
+ USER turinguser
11
+
12
+ WORKDIR /app
13
+
14
+ # Copy your Prometheus config and set ownership
15
+ COPY --chown=turinguser turing_cloud.yml .
16
+
17
+ # Expose Prometheus port
18
+ EXPOSE 9090
19
+
20
+ # Run Prometheus with your custom config
21
+ CMD [ "/bin/prometheus", "--config.file=/app/turing_cloud.yml" ]
turing_cloud.yml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # my global config
2
+ global:
3
+ scrape_interval: 15s # Kept your faster 15s interval (better resolution)
4
+ evaluation_interval: 15s # Evaluate rules every 15s
5
+ scrape_timeout: 10s # Global default
6
+
7
+ # --- GRAFANA CLOUD CONNECTION ---
8
+ # This sends your metrics to the cloud.
9
+ # It sits at the top level, indented securely under no other block.
10
+ remote_write:
11
+ - url: https://prometheus-prod-65-prod-eu-west-2.grafana.net/api/prom/push
12
+ basic_auth:
13
+ username: 2894335
14
+ password: glc_eyJvIjoiMTYzMjA0NSIsIm4iOiJzdGFjay0xNDg1MDUxLWFsbG95LXR1cmluZ19hcGkiLCJrIjoiRjJvajQ5N2EwWWJpcTA2aFNXZ3FYMzIxIiwibSI6eyJyIjoicHJvZC1ldS13ZXN0LTIifX0=
15
+
16
+ # Alertmanager configuration
17
+ alerting:
18
+ alertmanagers:
19
+ - static_configs:
20
+ - targets:
21
+ # - alertmanager:9093
22
+
23
+ # Load rules once and periodically evaluate them
24
+ rule_files:
25
+ # - "first_rules.yml"
26
+ # - "second_rules.yml"
27
+
28
+ # --- SCRAPE CONFIGURATIONS ---
29
+ scrape_configs:
30
+ # JOB 1: Your Application (Turing API)
31
+ - job_name: "turing"
32
+ static_configs:
33
+ - targets: ["https://turing-team-turing-space.hf.space"]
34
+ labels:
35
+ app: "turing_api"
36
+
37
+ # JOB 2: Prometheus Internal Metrics (Recommended)
38
+ # It is good practice to let Prometheus monitor itself.
39
+ - job_name: "prometheus"
40
+ static_configs:
41
+ - targets: ["https://turing-team-turing-promethetus-server.hf.space"]