@@ -215,10 +215,10 @@ jobs:
215
215
tags=${{ needs.setup.outputs.tags }}
216
216
" > environment.properties
217
217
218
- - name : Convert metrics JSON to Prometheus format
218
+ - name : Convert metrics JSON to Datadog format
219
219
working-directory : ' ./packages/e2e-tests/tools/'
220
220
run : |
221
- ./convert_metrics_to_prometheus .sh "${{ github.workflow }}" "${{ github.run_id }}" ../../../artifacts/metrics
221
+ ./convert_metrics_to_datadog .sh "${{ github.workflow }}" "${{ github.run_id }}" ../../../artifacts/metrics "${{ secrets.DATADOG_API_KEY }}"
222
222
223
223
- name : Publish allure report to S3
224
224
@@ -269,67 +269,21 @@ jobs:
269
269
name : performance-metrics
270
270
path : ./artifacts/metrics
271
271
272
- - name : Serve metrics file locally
272
+ - name : Send E2E metrics to Datadog
273
273
run : |
274
- cat <<'PY' > serve_metrics.py
275
- import http.server, socketserver, pathlib, sys
276
- FILE = pathlib.Path('./artifacts/metrics/prometheus.txt')
277
- class H(http.server.SimpleHTTPRequestHandler):
278
- def do_GET(self):
279
- if self.path == './artifacts/metrics':
280
- content = FILE.read_bytes() if FILE.exists() else b'# metrics not ready\n'
281
- self.send_response(200)
282
- self.end_headers()
283
- self.wfile.write(content)
284
- else:
285
- self.send_error(404)
286
- with socketserver.TCPServer(('0.0.0.0', 9101), H) as s:
287
- print('Serving metrics on :9101/metrics', file=sys.stderr)
288
- s.serve_forever()
289
- PY
290
- python serve_metrics.py &
274
+ echo "📊 E2E metrics have been sent to Datadog via the conversion script"
275
+ echo "📁 Datadog payload saved to: ./artifacts/metrics/datadog_payload.json"
276
+ echo "🔍 Check the previous step for detailed metrics information"
291
277
292
278
# ------------------------------------------------------------------------
293
279
# 3) Write Alloy (River) config — scrape localhost:9101 and remote_write
294
280
# ------------------------------------------------------------------------
295
- - name : Generate alloy.river
296
- env :
297
- GRAFANA_CLOUD_USERNAME : ${{ secrets.GRAFANA_ALLOY_USERNAME }}
298
- GRAFANA_CLOUD_API_KEY : ${{ secrets.GRAFANA_ALLOY_API_KEY }}
299
- run : |
300
- mkdir -p alloy
301
- cat > alloy/alloy.river <<RIVER
302
- prometheus.remote_write "gc" {
303
- endpoint {
304
- url = "https://prometheus-us-central1.grafana.net/api/prom/push"
305
- basic_auth {
306
- username = env("GRAFANA_CLOUD_USERNAME")
307
- password = env("GRAFANA_CLOUD_API_KEY")
308
- }
309
- }
310
- }
311
-
312
- prometheus.scrape "e2e" {
313
- targets = [{
314
- __address__ = "127.0.0.1:9101",
315
- }]
316
- forward_to = [prometheus.remote_write.gc.receiver]
317
- }
318
- RIVER
281
+
319
282
320
283
# ------------------------------------------------------------------------
321
284
# 4) Launch Alloy for ~45 s to scrape + push the data, then shut it down.
322
285
# ------------------------------------------------------------------------
323
- - name : Run Alloy and push metrics
324
- run : |
325
- docker run --rm \
326
- -e ALLOY_CONFIG=/etc/alloy.river \
327
- -v "$PWD/alloy/alloy.river:/etc/alloy.river:ro" \
328
- grafana/alloy:latest run /etc/alloy.river &
329
- ALLOY_PID=$!
330
- # wait for two scrape cycles + remote write
331
- sleep 45
332
- kill "$ALLOY_PID" || true
286
+
333
287
334
288
# - name: Create Prometheus config
335
289
# env:
0 commit comments