Skip to content

Commit c10f057

Browse files
committed
upload nightly prom metrics to s3
1 parent 50d15bd commit c10f057

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/nightly-throughput-stress.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: '00 11 * * *'
77
push:
88
branches:
9-
- add-nightly-throughput-stress-workflow
9+
- upload-nightly-metrics-to-s3
1010
workflow_dispatch:
1111
inputs:
1212
duration:
@@ -35,6 +35,9 @@ env:
3535
# Logging and artifacts
3636
WORKER_LOG_DIR: /tmp/throughput-stress-logs
3737

38+
# AWS S3 metrics upload ARN
39+
AWS_S3_METRICS_UPLOAD_ROLE_ARN: ${{ vars.AWS_S3_METRICS_UPLOAD_ROLE_ARN }}
40+
3841
# Omes configuration
3942
OMES_REPO: temporalio/omes
4043
OMES_REF: main
@@ -44,6 +47,10 @@ jobs:
4447
throughput-stress:
4548
runs-on: ubuntu-latest-4-cores
4649
timeout-minutes: ${{ fromJSON(inputs.job_timeout_minutes || vars.NIGHTLY_JOB_TIMEOUT_MINUTES || 360) }}
50+
permissions:
51+
contents: read
52+
actions: write
53+
id-token: write
4754

4855
steps:
4956
- name: Print test configuration
@@ -88,6 +95,14 @@ jobs:
8895
- name: Install Temporal CLI
8996
uses: temporalio/setup-temporal@v0
9097

98+
- name: Install Prometheus
99+
run: |
100+
PROM_VERSION="3.8.0"
101+
wget -q https://github.com/prometheus/prometheus/releases/download/v${PROM_VERSION}/prometheus-${PROM_VERSION}.linux-amd64.tar.gz
102+
tar xzf prometheus-${PROM_VERSION}.linux-amd64.tar.gz
103+
sudo mv prometheus-${PROM_VERSION}.linux-amd64/prometheus /usr/local/bin/
104+
prometheus --version
105+
91106
- name: Setup log directory
92107
run: mkdir -p $WORKER_LOG_DIR
93108

@@ -120,13 +135,37 @@ jobs:
120135
--duration $TEST_DURATION \
121136
--timeout $TEST_TIMEOUT \
122137
--max-concurrent 10 \
138+
--prom-listen-address 127.0.0.1:9091 \
139+
--worker-prom-listen-address 127.0.0.1:9092 \
140+
--prom-instance-addr 127.0.0.1:9090 \
141+
--prom-instance-config \
142+
--prom-export-worker-metrics $RUN_ID.parquet \
123143
--option internal-iterations=10 \
124144
--option continue-as-new-after-iterations=3 \
125145
--option sleep-time=1s \
126146
--option visibility-count-timeout=5m \
127147
--option min-throughput-per-hour=1000 \
128148
2>&1 | tee $WORKER_LOG_DIR/scenario.log
129149
150+
- name: Configure AWS credentials
151+
if: always()
152+
uses: aws-actions/configure-aws-credentials@v4
153+
with:
154+
role-to-assume: ${{ env.AWS_S3_METRICS_UPLOAD_ROLE_ARN }}
155+
aws-region: us-west-2
156+
157+
- name: Upload metrics to S3
158+
if: always()
159+
run: |
160+
DATE=$(date +%Y-%m-%d)
161+
# Use test/ prefix on non-main branches
162+
PREFIX="language=java/date=$DATE"
163+
if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
164+
PREFIX="test/$PREFIX"
165+
fi
166+
aws s3 cp omes/$RUN_ID.parquet \
167+
"s3://cloud-data-ingest-prod/github/sdk_load_test/$PREFIX/$RUN_ID.parquet"
168+
130169
- name: Upload logs on failure
131170
if: failure() || cancelled()
132171
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)