@@ -249,6 +249,9 @@ jobs:
249
249
SLACK_TITLE : ' Test automation results :rocket:'
250
250
SLACK_USERNAME : lace-qa-bot
251
251
SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
252
+ PUSH_URL : ${{ secrets.GRAFANA_PUSH_URL }} # e.g., https://prometheus-us-central1.grafana.net/api/prom/push
253
+ PUSH_USER : ${{ secrets.GRAFANA_USERNAME }} # e.g., 787878
254
+ PUSH_PASS : ${{ secrets.GRAFANA_PASSWORD }} # e.g., eyJrIjoxxxxxxxxxxxxxxyMX0=
252
255
253
256
- name : Deleting chrome tmp files
254
257
id : clean-chrome-tmp-files
@@ -268,3 +271,33 @@ jobs:
268
271
with :
269
272
name : performance-metrics
270
273
path : ./artifacts/metrics
274
+
275
+ - name : Create Prometheus config
276
+ run : |
277
+ cat >prometheus.yml <<EOF
278
+ global:
279
+ scrape_interval: 15s
280
+ scrape_configs:
281
+ - job_name: 'e2e-perf-metrics'
282
+ static_configs:
283
+ - targets: ['http-server:8000']
284
+ metrics_path: '/artifacts/metrics/prometheus.txt'
285
+ remote_write:
286
+ - url: "$PUSH_URL"
287
+ basic_auth:
288
+ username: "$PUSH_USER"
289
+ password: "$PUSH_PASS"
290
+ EOF
291
+ cat ./artifacts/metrics/prometheus.txt
292
+
293
+ - name : Start Python HTTP server
294
+ run : |
295
+ docker run -d --name http-server -v $(pwd):/app -w /app -p 8000:8000 python:3.11-slim python -m http.server 8000 > http.log 2>&1
296
+
297
+ - name : Run Prometheus
298
+ run : |
299
+ docker run -d --name prometheus -v $(pwd):/etc/prometheus -p 9090:9090 --link http-server prom/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address=:9090 > prom.log 2>&1
300
+ sleep 60
301
+ # Uncomment for troubleshooting.
302
+ curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total
303
+
0 commit comments