@@ -276,28 +276,49 @@ jobs:
276
276
run : |
277
277
cat >prometheus.yml <<EOF
278
278
global:
279
- scrape_interval: 15s
279
+ scrape_interval: 5s
280
280
scrape_configs:
281
281
- job_name: 'e2e-perf-metrics'
282
282
static_configs:
283
- - targets: ['http-server:8000']
284
- metrics_path: '/prometheus.txt'
283
+ - targets: ['pushgateway:9091']
285
284
remote_write:
286
285
- url: "$PUSH_URL"
287
286
basic_auth:
288
287
username: "$PUSH_USER"
289
288
password: "$PUSH_PASS"
290
289
EOF
291
- cat ./artifacts/metrics/prometheus.txt
290
+ pwd
291
+ ls -al ./artifacts/metrics/prometheus.txt
292
292
293
- - name : Start Python HTTP server
293
+ - name : Start pushgateway server
294
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
295
+ docker run -d --name pushgateway -p 9091:9091 prom/pushgateway
296
+ cat ./artifacts/metrics/prometheus.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
297
+ #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
298
+ printf '\n*****************\n'
299
+ echo 'This is my current directory:'
296
300
pwd
301
+ printf '\n*****************\n'
302
+ echo 'This is ls -al in that directory'
303
+ ls -al
304
+ printf '\n*****************\n'
305
+
306
+ - name : Test prometheus auth
307
+ run : |
308
+ # get a shell
309
+ docker exec -it prometheus sh
310
+ # from inside:
311
+ curl -v -u "$PUSH_USER:$PUSH_PASS" "$PUSH_URL"
312
+
297
313
- name : Run Prometheus
298
314
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.
315
+ 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
316
+ sleep 200
317
+ # # Uncomment for troubleshooting.
318
+ printf '\n*****************\n'
319
+ printf '\n curl e2e_cpu_seconds_total \n'
302
320
curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total
321
+ printf '\n*****************\n'
322
+ printf 'cat prom.log'
323
+ cat prom.log
303
324
0 commit comments