File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -268,3 +268,43 @@ jobs:
268
268
with :
269
269
name : performance-metrics
270
270
path : ./artifacts/metrics
271
+
272
+ pushPromPerfMetrics :
273
+ runs-on : ${{ needs.setup.outputs.runner }}
274
+ env :
275
+ PUSH_URL : ${{ secrets.GRAFANA_PUSH_URL }} # e.g., https://prometheus-us-central1.grafana.net/api/prom/push
276
+ PUSH_USER : ${{ secrets.GRAFANA_USERNAME }} # e.g., 787878
277
+ PUSH_PASS : ${{ secrets.GRAFANA_PASSWORD }} # e.g., eyJrIjoxxxxxxxxxxxxxxyMX0=
278
+ steps :
279
+ - name : Checkout
280
+ uses : actions/checkout@v4
281
+
282
+ - name : Create Prometheus config
283
+ run : |
284
+ cat >prometheus.yml <<EOF
285
+ global:
286
+ scrape_interval: 15s
287
+ scrape_configs:
288
+ - job_name: 'e2e-perf-metrics'
289
+ static_configs:
290
+ - targets: ['http-server:8000']
291
+ metrics_path: '.artifacts/metrics'
292
+ remote_write:
293
+ - url: "$PUSH_URL"
294
+ basic_auth:
295
+ username: "$PUSH_USER"
296
+ password: "$PUSH_PASS"
297
+ EOF
298
+
299
+ - name : Start Python HTTP server
300
+ run : |
301
+ 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
302
+
303
+ - name : Run Prometheus
304
+ run : |
305
+ 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
306
+ sleep 60
307
+ # Uncomment for troubleshooting.
308
+ # curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total
309
+
310
+
You can’t perform that action at this time.
0 commit comments