@@ -8,6 +8,7 @@ This is a simple guide to add Datadog monitoring to your Lace CI/CD pipelines.
8
8
1 . Create account at [ datadoghq.com] ( https://datadoghq.com ) (free tier available)
9
9
2 . Go to ** Organization Settings** → ** API Keys**
10
10
3 . Create new API key named "Lace CI Integration"
11
+ 4 . ** Important** : Ensure the key has "Metrics Write" permission
11
12
12
13
### 2. Add GitHub Secret
13
14
1 . 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.
19
20
### 3. Use the New Workflow
20
21
Replace your current ` ci.yml ` with ` ci-with-datadog.yml ` or add Datadog to existing workflows.
21
22
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
+
22
51
## What You'll Get
23
52
24
53
### 📊 ** One Dashboard for All Pipelines**
@@ -74,21 +103,61 @@ sum:github.ci.pipeline.status{status:failure,service:lace-wallet} / sum:github.c
74
103
avg:github.ci.job.duration{service:lace-wallet,workflow:ci} > 1800
75
104
```
76
105
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
+
77
143
## Files Created
78
144
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
82
149
83
150
## Next Steps
84
151
85
152
1 . ** Set up your Datadog account** and API key
86
153
2 . ** Add the secret** to GitHub
87
- 3 . ** Test the integration** with a small PR
154
+ 3 . ** Test the integration** using the test workflow
88
155
4 . ** Create dashboards** using the queries above
89
156
5 . ** Set up alerts** for critical failures
157
+ 6 . ** Integrate with your main CI/CD** workflows
90
158
91
159
## Support
92
160
93
161
- [ Datadog CI Documentation] ( https://docs.datadoghq.com/continuous_integration/ )
94
162
- [ 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