Skip to content

Commit 3a19c68

Browse files
committed
chore: move timestamp back to labels
1 parent d5a917f commit 3a19c68

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,6 @@ jobs:
263263
name: allure-results
264264
path: ./artifacts/reports/allure/results
265265

266-
- name: Push renamed metrics
267-
working-directory: './artifacts/metrics'
268-
run: |
269-
sed -E '
270-
s/^(e2e_cpu_seconds_total)\{/e2e_cpu_seconds_total_v1\{/;
271-
s/^(e2e_memory_rss_bytes)\{/e2e_memory_rss_bytes_v1\{/
272-
' prometheus.txt > prometheus_renamed.txt
273-
sed -E 's/\s+[0-9]+(\.[0-9]+)?$//' prometheus.txt > prometheus_no_ts.txt
274-
printf '\n*****************\n'
275-
printf '\n curl e2e_cpu_seconds_total \n'
276-
cat prometheus_renamed.txt
277-
278266
- name: Upload performance metrics
279267
uses: actions/upload-artifact@v4
280268
with:
@@ -302,11 +290,12 @@ jobs:
302290
EOF
303291
pwd
304292
ls -al ./artifacts/metrics/prometheus.txt
293+
head ./artifacts/metrics/prometheus.txt
305294
306295
- name: Start pushgateway server
307296
run: |
308297
docker run -d --name pushgateway -p 9091:9091 prom/pushgateway
309-
cat ./artifacts/metrics/prometheus_no_ts.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
298+
cat ./artifacts/metrics/prometheus.txt | curl --data-binary @- http://localhost:9091/metrics/job/e2e-perf
310299
#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
311300
printf '\n*****************\n'
312301
echo 'This is my current directory:'
@@ -321,11 +310,14 @@ jobs:
321310
# Enable logs for debugging
322311
#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
323312
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
324-
sleep 20
313+
sleep 60
325314
# Uncomment for troubleshooting.
326315
printf '\n*****************\n'
327316
printf '\n curl e2e_cpu_seconds_total \n'
328317
curl http://localhost:9090/api/v1/query?query=e2e_cpu_seconds_total_v1
318+
printf '\n*****************\n'
319+
printf '\n cat prom.log \n'
320+
cat prom.log
329321
#printf '\n*****************\n'
330322
#printf '\n send_failures_total \n'
331323
#curl 'http://localhost:9090/api/v1/query?query=prometheus_remote_storage_queue_send_failures_total'

packages/e2e-tests/tools/convert_metrics_to_prometheus.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ for file in "${FILES[@]}"; do
5656
cpu=$(echo "$entry" | jq -r '.cpu')
5757
memory=$(echo "$entry" | jq -r '.memory')
5858

59-
echo "e2e_cpu_seconds_total{scenario_name=\"$scenario_name\",scenario_id=\"$scenario_id\",job=\"$JOB\",instance=\"$INSTANCE\"} $cpu $timestamp" >> "$OUTPUT_FILE"
60-
echo "e2e_memory_rss_bytes{scenario_name=\"$scenario_name\",scenario_id=\"$scenario_id\",job=\"$JOB\",instance=\"$INSTANCE\"} $memory $timestamp" >> "$OUTPUT_FILE"
59+
echo "e2e_cpu_seconds_total{scenario_name=\"$scenario_name\",scenario_id=\"$scenario_id\",job=\"$JOB\",instance=\"$INSTANCE\",timestamp=\"$timestamp\"} $cpu" >> "$OUTPUT_FILE"
60+
echo "e2e_memory_rss_bytes{scenario_name=\"$scenario_name\",scenario_id=\"$scenario_id\",job=\"$JOB\",instance=\"$INSTANCE\",timestamp=\"$timestamp\"} $memory" >> "$OUTPUT_FILE"
6161
done
6262
fi
6363
done

0 commit comments

Comments
 (0)