|
| 1 | +# Datadog Metrics Guide for Lace CI |
| 2 | + |
| 3 | +## ✅ **Good News: Your Datadog Integration is Working!** |
| 4 | + |
| 5 | +Your API key is valid and the workflow is successfully sending both **metrics** and **events** to Datadog. |
| 6 | + |
| 7 | +## 📊 **Metrics Being Sent** |
| 8 | + |
| 9 | +The workflow sends these metrics to Datadog: |
| 10 | + |
| 11 | +### 1. **CI Pipeline Metrics** |
| 12 | +- **Metric Name**: `github.ci.pipeline.duration` |
| 13 | +- **Tags**: `service:lace-wallet`, `env:ci`, `workflow:ci`, `job:datadog-ci` |
| 14 | +- **Type**: Gauge |
| 15 | +- **Description**: Duration of CI pipeline execution |
| 16 | + |
| 17 | +- **Metric Name**: `github.ci.pipeline.status` |
| 18 | +- **Tags**: `service:lace-wallet`, `env:ci`, `workflow:ci`, `job:datadog-ci`, `status:success/failure` |
| 19 | +- **Type**: Gauge |
| 20 | +- **Description**: Success/failure status of CI pipeline |
| 21 | + |
| 22 | +### 2. **Build Metrics** |
| 23 | +- **Metric Name**: `lace.build.packages` |
| 24 | +- **Tags**: `service:lace-wallet`, `env:ci`, `workflow:ci`, `status:success/failure` |
| 25 | +- **Type**: Gauge |
| 26 | +- **Description**: Build package completion status |
| 27 | + |
| 28 | +### 3. **Test Metrics** |
| 29 | +- **Metric Name**: `lace.tests.unit` |
| 30 | +- **Tags**: `service:lace-wallet`, `env:ci`, `workflow:ci`, `status:success/failure` |
| 31 | +- **Type**: Gauge |
| 32 | +- **Description**: Unit test execution status |
| 33 | + |
| 34 | +### 4. **Release Metrics** |
| 35 | +- **Metric Name**: `lace.release.package` |
| 36 | +- **Tags**: `service:lace-wallet`, `env:ci`, `workflow:release-pkg`, `status:success/failure` |
| 37 | +- **Type**: Gauge |
| 38 | +- **Description**: Release package creation status |
| 39 | + |
| 40 | +## 🔍 **How to Find These Metrics in Datadog** |
| 41 | + |
| 42 | +### **Method 1: Metrics Explorer** |
| 43 | +1. Go to **Metrics** → **Explorer** in Datadog |
| 44 | +2. Search for these metric names: |
| 45 | + - `github.ci.pipeline.duration` |
| 46 | + - `github.ci.pipeline.status` |
| 47 | + - `lace.build.packages` |
| 48 | + - `lace.tests.unit` |
| 49 | + - `lace.release.package` |
| 50 | + |
| 51 | +### **Method 2: Query by Service** |
| 52 | +1. Go to **Metrics** → **Explorer** |
| 53 | +2. Filter by: `service:lace-wallet` |
| 54 | +3. This will show all metrics tagged with your service |
| 55 | + |
| 56 | +### **Method 3: Query by Environment** |
| 57 | +1. Go to **Metrics** → **Explorer** |
| 58 | +2. Filter by: `env:ci` |
| 59 | +3. This will show all CI-related metrics |
| 60 | + |
| 61 | +### **Method 4: Events Section** |
| 62 | +1. Go to **Events** in Datadog |
| 63 | +2. Look for events with title: "Lace CI Pipeline Complete" |
| 64 | +3. Filter by: `service:lace-wallet` |
| 65 | + |
| 66 | +## 📈 **Sample Queries for Dashboards** |
| 67 | + |
| 68 | +### **Pipeline Success Rate** |
| 69 | +``` |
| 70 | +sum:github.ci.pipeline.status{status:success,service:lace-wallet} / sum:github.ci.pipeline.status{service:lace-wallet} |
| 71 | +``` |
| 72 | + |
| 73 | +### **Average Pipeline Duration** |
| 74 | +``` |
| 75 | +avg:github.ci.pipeline.duration{service:lace-wallet} |
| 76 | +``` |
| 77 | + |
| 78 | +### **Build Success Rate** |
| 79 | +``` |
| 80 | +sum:lace.build.packages{status:success,service:lace-wallet} / sum:lace.build.packages{service:lace-wallet} |
| 81 | +``` |
| 82 | + |
| 83 | +### **Test Success Rate** |
| 84 | +``` |
| 85 | +sum:lace.tests.unit{status:success,service:lace-wallet} / sum:lace.tests.unit{service:lace-wallet} |
| 86 | +``` |
| 87 | + |
| 88 | +## 🚨 **Troubleshooting** |
| 89 | + |
| 90 | +### **If you can't see metrics:** |
| 91 | +1. **Wait 5-10 minutes** - Metrics can take time to appear |
| 92 | +2. **Check the time range** - Make sure you're looking at recent data |
| 93 | +3. **Verify tags** - Use the exact tag combinations listed above |
| 94 | +4. **Check for typos** - Metric names are case-sensitive |
| 95 | + |
| 96 | +### **If you see events but not metrics:** |
| 97 | +1. **Check the workflow logs** - Look for "Sending metrics to Datadog..." messages |
| 98 | +2. **Verify API responses** - Should show HTTP 202 for success |
| 99 | +3. **Check metric names** - Use the exact names listed above |
| 100 | + |
| 101 | +## 🎯 **Next Steps** |
| 102 | + |
| 103 | +1. **Create a dashboard** using the sample queries above |
| 104 | +2. **Set up alerts** for pipeline failures |
| 105 | +3. **Monitor trends** in build and test performance |
| 106 | +4. **Share the dashboard** with your team |
| 107 | + |
| 108 | +## 📞 **Support** |
| 109 | + |
| 110 | +If you still can't see the metrics: |
| 111 | +1. Check the workflow logs for any error messages |
| 112 | +2. Verify the metric names in the Datadog Metrics Explorer |
| 113 | +3. Try the sample queries above |
| 114 | +4. Contact Datadog support if needed |
0 commit comments