@@ -8,6 +8,7 @@ This is a simple guide to add Datadog monitoring to your Lace CI/CD pipelines.
881 . Create account at [ datadoghq.com] ( https://datadoghq.com ) (free tier available)
992 . Go to ** Organization Settings** → ** API Keys**
10103 . Create new API key named "Lace CI Integration"
11+ 4 . ** Important** : Ensure the key has "Metrics Write" permission
1112
1213### 2. Add GitHub Secret
13141 . Go to your Lace repository on GitHub
@@ -19,6 +20,34 @@ This is a simple guide to add Datadog monitoring to your Lace CI/CD pipelines.
1920### 3. Use the New Workflow
2021Replace your current ` ci.yml ` with ` ci-with-datadog.yml ` or add Datadog to existing workflows.
2122
23+ ## API Integration Details
24+
25+ ### Datadog v2 API Format
26+ The working payload format for Datadog v2 API:
27+
28+ ``` json
29+ {
30+ "series" : [{
31+ "metric" : " test.datadog.integration" ,
32+ "points" : [{"timestamp" : 1703123456 , "value" : 42 }],
33+ "tags" : [" service:lace-wallet" , " env:test" , " workflow:test-datadog" ]
34+ }]
35+ }
36+ ```
37+
38+ ### Key Requirements
39+ - ** Timestamp** : Must be Unix timestamp (seconds since epoch)
40+ - ** Points format** : Array of ` {"timestamp": X, "value": Y} ` objects
41+ - ** Tags** : Array of strings in ` key:value ` format
42+ - ** Headers** :
43+ - ` Content-Type: application/json `
44+ - ` DD-API-KEY: your-api-key `
45+
46+ ### API Endpoint
47+ ```
48+ POST https://api.us5.datadoghq.com/api/v2/series
49+ ```
50+
2251## What You'll Get
2352
2453### 📊 ** One Dashboard for All Pipelines**
@@ -74,21 +103,61 @@ sum:github.ci.pipeline.status{status:failure,service:lace-wallet} / sum:github.c
74103avg:github.ci.job.duration{service:lace-wallet,workflow:ci} > 1800
75104```
76105
106+ ## Troubleshooting
107+
108+ ### Common Issues
109+
110+ 1 . ** HTTP 403 Forbidden**
111+ - Check API key permissions (needs "Metrics Write")
112+ - Verify API key is correct
113+ - Ensure you're using the right Datadog site (us5.datadoghq.com)
114+
115+ 2 . ** HTTP 400 Bad Request**
116+ - Check JSON payload format
117+ - Ensure timestamps are Unix timestamps (seconds, not milliseconds)
118+ - Verify tags are in correct format
119+
120+ 3 . ** HTTP 401 Unauthorized**
121+ - API key is invalid or expired
122+ - Check if the key has proper permissions
123+
124+ ### Testing Your Integration
125+
126+ Use the ` test-datadog.yml ` workflow to verify your setup:
127+
128+ 1 . ** Manual trigger** : Go to Actions → Test Datadog v2 API → Run workflow
129+ 2 . ** Check logs** : Look for "✅ SUCCESS: Metrics sent successfully to Datadog!"
130+ 3 . ** Verify in Datadog** :
131+ - Go to Metrics Explorer
132+ - Search for ` test.datadog.integration `
133+ - Set time range to "Last 1 hour"
134+ - Look for metrics with tags: ` service:lace-wallet, env:test `
135+
136+ ### Debugging Tips
137+
138+ - The test workflow provides detailed logging
139+ - Check HTTP status codes (202 = success)
140+ - Validate JSON payload with ` jq `
141+ - Monitor response times for performance issues
142+
77143## Files Created
78144
79- 1 . ** ` .github/workflows/datadog-ci.yml ` ** - Reusable Datadog workflow
80- 2 . ** ` .github/workflows/ci-with-datadog.yml ` ** - CI with Datadog integration
81- 3 . ** ` docs/datadog-setup.md ` ** - This guide
145+ 1 . ** ` .github/workflows/test-datadog.yml ` ** - Test workflow for Datadog integration
146+ 2 . ** ` .github/workflows/datadog-ci.yml ` ** - Reusable Datadog workflow
147+ 3 . ** ` .github/workflows/ci-with-datadog.yml ` ** - CI with Datadog integration
148+ 4 . ** ` docs/datadog-setup.md ` ** - This guide
82149
83150## Next Steps
84151
851521 . ** Set up your Datadog account** and API key
861532 . ** Add the secret** to GitHub
87- 3 . ** Test the integration** with a small PR
154+ 3 . ** Test the integration** using the test workflow
881554 . ** Create dashboards** using the queries above
891565 . ** Set up alerts** for critical failures
157+ 6 . ** Integrate with your main CI/CD** workflows
90158
91159## Support
92160
93161- [ Datadog CI Documentation] ( https://docs.datadoghq.com/continuous_integration/ )
94162- [ GitHub Actions Integration] ( https://github.com/DataDog/github-action-metrics )
163+ - [ Datadog v2 API Reference] ( https://docs.datadoghq.com/api/latest/metrics/ )
0 commit comments