@@ -249,9 +249,6 @@ 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=
255
252
256
253
- name : Deleting chrome tmp files
257
254
id : clean-chrome-tmp-files
@@ -273,31 +270,55 @@ jobs:
273
270
path : ./artifacts/metrics
274
271
275
272
- name : Create Prometheus config
273
+ env :
274
+ PUSH_URL : ${{ secrets.GRAFANA_PUSH_URL }} # e.g., https://prometheus-us-central1.grafana.net/api/prom/push
275
+ PUSH_USER : ${{ secrets.GRAFANA_USERNAME }} # e.g., 787878
276
+ PUSH_PASS : ${{ secrets.GRAFANA_PASSWORD }} # e.g., eyJrIjoxxxxxxxxxxxxxxyMX0=
276
277
run : |
277
278
cat >prometheus.yml <<EOF
278
279
global:
279
- scrape_interval: 15s
280
+ scrape_interval: 5s
280
281
scrape_configs:
281
282
- job_name: 'e2e-perf-metrics'
282
283
static_configs:
283
- - targets: ['http-server:8000']
284
- metrics_path: '/prometheus.txt'
284
+ - targets: ['pushgateway:9091']
285
285
remote_write:
286
286
- url: "$PUSH_URL"
287
287
basic_auth:
288
288
username: "$PUSH_USER"
289
289
password: "$PUSH_PASS"
290
290
EOF
291
- cat ./artifacts/metrics/prometheus.txt
291
+ pwd
292
+ ls -al ./artifacts/metrics/prometheus.txt
292
293
293
- - name : Start Python HTTP server
294
+ - name : Start pushgateway server
294
295
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
+ docker run -d --name pushgateway -p 9091:9091 prom/pushgateway
297
+ cat ./artifacts/metrics/prometheus.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
298
+ #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
299
+ printf '\n*****************\n'
300
+ echo 'This is my current directory:'
296
301
pwd
302
+ printf '\n*****************\n'
303
+ echo 'This is ls -al in that directory'
304
+ ls -al
305
+ printf '\n*****************\n'
306
+
297
307
- name : Run Prometheus
298
308
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
309
+ # Enable logs for debugging
310
+ #docker run --name prometheus -v $(pwd):/etc/prometheus -p 9090:9090 --link pushgateway:pushgateway prom/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address=:9090 --log.level=debug
311
+ docker run -d --name prometheus -v $(pwd):/etc/prometheus -p 9090:9090 --link pushgateway:pushgateway prom/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address=:9090 > prom.log 2>&1
312
+ sleep 20
313
+ # # Uncomment for troubleshooting.
314
+ #printf '\n*****************\n'
315
+ #printf '\n curl e2e_cpu_seconds_total \n'
316
+ #curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total
317
+ #printf '\n*****************\n'
318
+ #printf '\n send_failures_total \n'
319
+ #curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_queue_send_failures_total'
320
+ #printf '\n*****************\n'
321
+ #printf '\n storage_retries_total \n'
322
+ #curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_retries_total'
323
+
303
324
0 commit comments