Skip to content

Commit f176e22

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

File tree

2 files changed

+57
-66
lines changed

2 files changed

+57
-66
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,65 @@ jobs:
439439
./packages/e2e-tests/screenshots
440440
./packages/e2e-tests/logs
441441
./packages/e2e-tests/reports
442+
./packages/e2e-tests/metrics
442443
retention-days: 5
443444

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