Skip to content

Commit a36db20

Browse files
committed
chore: mimimum datadog test in main
1 parent 5a6a8f4 commit a36db20

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

β€Ž.github/workflows/test-datadog.ymlβ€Ž

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test Datadog v2 API
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ berno_prom_metrics ]
6+
branches: [ main, test/berno_prom_metrics ]
77

88
jobs:
99
test-datadog:
@@ -27,26 +27,33 @@ jobs:
2727
if [ -n "${{ secrets.DATADOG_API_KEY }}" ]; then
2828
echo "βœ… API Key is set, proceeding with test..."
2929
30-
# Get current timestamp
31-
timestamp=$(date +%s)
32-
echo "πŸ“… Using timestamp: $timestamp"
33-
34-
# Prepare the JSON payload
30+
# Prepare the JSON payload (let Datadog use current time)
3531
json_payload="{
3632
\"series\": [{
3733
\"metric\": \"test.datadog.integration\",
38-
\"points\": [{\"timestamp\": $timestamp, \"value\": 42}],
34+
\"points\": [{\"timestamp\": $(date +%s), \"value\": 42}],
3935
\"tags\": [\"service:lace-wallet\", \"env:test\", \"workflow:test-datadog\", \"repo:${{ github.repository }}\", \"branch:${{ github.ref_name }}\", \"commit:${{ github.sha }}\"]
4036
}, {
41-
\"metric\": \"test.datadog.timestamp\",
42-
\"points\": [{\"timestamp\": $timestamp, \"value\": $timestamp}],
37+
\"metric\": \"test.datadog.simple\",
38+
\"points\": [{\"timestamp\": $(date +%s), \"value\": 100}],
4339
\"tags\": [\"service:lace-wallet\", \"env:test\", \"workflow:test-datadog\"]
40+
}, {
41+
\"metric\": \"test.datadog.workflow.duration\",
42+
\"points\": [{\"timestamp\": $(date +%s), \"value\": ${{ github.run_duration }}}],
43+
\"tags\": [\"service:lace-wallet\", \"env:test\", \"workflow:test-datadog\", \"job:test-datadog\"]
44+
}, {
45+
\"metric\": \"test.datadog.success\",
46+
\"points\": [{\"timestamp\": $(date +%s), \"value\": 1}],
47+
\"tags\": [\"service:lace-wallet\", \"env:test\", \"workflow:test-datadog\", \"status:success\"]
4448
}]
4549
}"
4650
4751
echo "πŸ“€ Sending JSON payload:"
4852
echo "$json_payload"
4953
echo ""
54+
echo "πŸ” JSON validation:"
55+
echo "$json_payload" | jq '.' 2>/dev/null && echo "βœ… JSON is valid" || echo "❌ JSON is invalid"
56+
echo ""
5057
5158
# Send metrics to Datadog v2 API
5259
echo "πŸš€ Sending request to Datadog v2 API..."

0 commit comments

Comments
Β (0)