Skip to content

Commit 8c59f12

Browse files
committed
test: move performance metrics creation from e2e-split to smoke
1 parent 43bb567 commit 8c59f12

File tree

2 files changed

+60
-66
lines changed

2 files changed

+60
-66
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ jobs:
412412
working-directory: './packages/e2e-tests/tools/'
413413
run: |
414414
./convert_metrics_to_prometheus.sh "${{ github.workflow }}" "${{ github.run_id }}" ../../../metrics
415+
ls -la ../
416+
ls -la ../../
417+
ls -la ../../../
415418
416419
- name: Publish allure report to S3
417420
uses: andrcuns/allure-publish-action@v2.9.0
@@ -439,8 +442,65 @@ jobs:
439442
./packages/e2e-tests/screenshots
440443
./packages/e2e-tests/logs
441444
./packages/e2e-tests/reports
445+
./packages/e2e-tests/metrics
442446
retention-days: 5
443447

448+
- name: Create Prometheus config
449+
env:
450+
PUSH_URL: ${{ secrets.GRAFANA_PUSH_URL }} # e.g., https://prometheus-us-central1.grafana.net/api/prom/push
451+
PUSH_USER: ${{ secrets.GRAFANA_USERNAME }} # e.g., 787878
452+
PUSH_PASS: ${{ secrets.GRAFANA_PASSWORD }} # e.g., eyJrIjoxxxxxxxxxxxxxxyMX0=
453+
run: |
454+
cat >prometheus.yml <<EOF
455+
global:
456+
scrape_interval: 5s
457+
scrape_configs:
458+
- job_name: 'e2e-perf-metrics'
459+
static_configs:
460+
- targets: ['pushgateway:9091']
461+
remote_write:
462+
- url: "$PUSH_URL"
463+
basic_auth:
464+
username: "$PUSH_USER"
465+
password: "$PUSH_PASS"
466+
EOF
467+
pwd
468+
ls -al ./metrics/prometheus.txt
469+
head ./metrics/prometheus.txt
470+
471+
- name: Start pushgateway server
472+
run: |
473+
docker run -d --name pushgateway -p 9091:9091 prom/pushgateway
474+
cat ./metrics/prometheus.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
475+
#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
476+
printf '\n*****************\n'
477+
echo 'This is my current directory:'
478+
pwd
479+
printf '\n*****************\n'
480+
echo 'This is ls -al in that directory'
481+
ls -al
482+
printf '\n*****************\n'
483+
484+
- name: Run Prometheus
485+
run: |
486+
# Enable logs for debugging
487+
#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
488+
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
489+
sleep 60
490+
# Uncomment for troubleshooting.
491+
printf '\n*****************\n'
492+
printf '\n curl e2e_cpu_seconds_total \n'
493+
curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total_v1
494+
printf '\n*****************\n'
495+
printf '\n cat prom.log \n'
496+
cat prom.log
497+
#printf '\n*****************\n'
498+
#printf '\n send_failures_total \n'
499+
#curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_queue_send_failures_total'
500+
#printf '\n*****************\n'
501+
#printf '\n storage_retries_total \n'
502+
#curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_retries_total'
503+
444504
- run: |
445505
if [[ ${{ needs.smokeTests.result }} == "success" ]]; then
446506
exit 0

.github/workflows/e2e-tests-linux-split.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ jobs:
194194
# when cancelling job always() will prevent step from being cancelled and we don't want process results in this case
195195
if: ${{ success() || failure() }}
196196
steps:
197-
- name: Checkout repository
198-
uses: actions/checkout@v4
199-
200197
- name: Download all artifacts
201198
uses: actions/download-artifact@v4
202199
with:
@@ -216,11 +213,6 @@ jobs:
216213
tags=${{ needs.setup.outputs.tags }}
217214
" > environment.properties
218215
219-
- name: Convert metrics JSON to Prometheus format
220-
working-directory: './packages/e2e-tests/tools/'
221-
run: |
222-
./convert_metrics_to_prometheus.sh "${{ github.workflow }}" "${{ github.run_id }}" ../../../artifacts/metrics
223-
224216
- name: Publish allure report to S3
225217
uses: andrcuns/allure-publish-action@v2.9.0
226218
env:
@@ -269,61 +261,3 @@ jobs:
269261
with:
270262
name: performance-metrics
271263
path: ./artifacts/metrics
272-
273-
- name: Create Prometheus config
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-
run: |
279-
cat >prometheus.yml <<EOF
280-
global:
281-
scrape_interval: 5s
282-
scrape_configs:
283-
- job_name: 'e2e-perf-metrics'
284-
static_configs:
285-
- targets: ['pushgateway:9091']
286-
remote_write:
287-
- url: "$PUSH_URL"
288-
basic_auth:
289-
username: "$PUSH_USER"
290-
password: "$PUSH_PASS"
291-
EOF
292-
pwd
293-
ls -al ./artifacts/metrics/prometheus.txt
294-
head ./artifacts/metrics/prometheus.txt
295-
296-
- name: Start pushgateway server
297-
run: |
298-
docker run -d --name pushgateway -p 9091:9091 prom/pushgateway
299-
cat ./artifacts/metrics/prometheus.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
300-
#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
301-
printf '\n*****************\n'
302-
echo 'This is my current directory:'
303-
pwd
304-
printf '\n*****************\n'
305-
echo 'This is ls -al in that directory'
306-
ls -al
307-
printf '\n*****************\n'
308-
309-
- name: Run Prometheus
310-
run: |
311-
# Enable logs for debugging
312-
#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
313-
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
314-
sleep 60
315-
# Uncomment for troubleshooting.
316-
printf '\n*****************\n'
317-
printf '\n curl e2e_cpu_seconds_total \n'
318-
curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total_v1
319-
printf '\n*****************\n'
320-
printf '\n cat prom.log \n'
321-
cat prom.log
322-
#printf '\n*****************\n'
323-
#printf '\n send_failures_total \n'
324-
#curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_queue_send_failures_total'
325-
#printf '\n*****************\n'
326-
#printf '\n storage_retries_total \n'
327-
#curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_retries_total'
328-
329-

0 commit comments

Comments
 (0)