Skip to content

Commit 6f2ee9d

Browse files
ewegaCopilot
andauthored
Add Copilot team adoption dashboards (apache#8966)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c43696a commit 6f2ee9d

4 files changed

Lines changed: 1108 additions & 0 deletions

File tree

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
{
2+
"annotations": {
3+
"list": [
4+
{
5+
"builtIn": 1,
6+
"datasource": {
7+
"type": "datasource",
8+
"uid": "grafana"
9+
},
10+
"enable": true,
11+
"hide": true,
12+
"iconColor": "rgba(0, 211, 255, 1)",
13+
"name": "Annotations & Alerts",
14+
"type": "dashboard"
15+
}
16+
]
17+
},
18+
"editable": true,
19+
"fiscalYearStartMonth": 0,
20+
"graphTooltip": 0,
21+
"links": [],
22+
"liveNow": false,
23+
"panels": [
24+
{
25+
"datasource": "mysql",
26+
"description": "Per-team and per-user Copilot activity in the selected time range",
27+
"fieldConfig": {
28+
"defaults": {
29+
"mappings": [],
30+
"thresholds": {
31+
"mode": "absolute",
32+
"steps": [
33+
{
34+
"color": "green",
35+
"value": null
36+
}
37+
]
38+
}
39+
},
40+
"overrides": []
41+
},
42+
"gridPos": {
43+
"h": 12,
44+
"w": 24,
45+
"x": 0,
46+
"y": 0
47+
},
48+
"id": 1,
49+
"options": {
50+
"cellHeight": "sm",
51+
"footer": {
52+
"countRows": false,
53+
"fields": "",
54+
"reducer": [
55+
"sum"
56+
],
57+
"show": false
58+
},
59+
"showHeader": true
60+
},
61+
"pluginVersion": "11.0.0",
62+
"targets": [
63+
{
64+
"datasource": "mysql",
65+
"format": "table",
66+
"rawQuery": true,
67+
"rawSql": "SELECT ut.team_slug as \"Team\", udm.user_login as \"User\", SUM(udm.user_initiated_interaction_count) as \"Interactions\", SUM(udm.code_generation_activity_count) as \"Suggestions\", SUM(udm.code_acceptance_activity_count) as \"Acceptances\", ROUND(SUM(udm.code_acceptance_activity_count) * 100.0 / NULLIF(SUM(udm.code_generation_activity_count), 0), 1) as \"Acceptance Rate %\" FROM _tool_copilot_user_teams ut JOIN _tool_copilot_user_daily_metrics udm ON ut.connection_id = udm.connection_id AND ut.scope_id = udm.scope_id AND ut.day = udm.day AND ut.user_id = udm.user_id WHERE ut.connection_id = ${connection_id} AND ut.scope_id = '${scope_id}' AND $__timeFilter(ut.day) GROUP BY ut.team_slug, udm.user_login HAVING SUM(udm.code_generation_activity_count) > 0 ORDER BY \"Suggestions\" DESC LIMIT 50",
68+
"refId": "A"
69+
}
70+
],
71+
"title": "Team and User Breakdown",
72+
"type": "table"
73+
},
74+
{
75+
"datasource": "mysql",
76+
"description": "Weekly suggestions by team over the selected time range",
77+
"fieldConfig": {
78+
"defaults": {
79+
"color": {
80+
"mode": "palette-classic"
81+
},
82+
"custom": {
83+
"axisBorderShow": false,
84+
"axisCenteredZero": false,
85+
"axisColorMode": "text",
86+
"axisLabel": "Count",
87+
"axisPlacement": "auto",
88+
"barAlignment": 0,
89+
"drawStyle": "line",
90+
"fillOpacity": 10,
91+
"gradientMode": "none",
92+
"hideFrom": {
93+
"legend": false,
94+
"tooltip": false,
95+
"viz": false
96+
},
97+
"insertNulls": false,
98+
"lineInterpolation": "linear",
99+
"lineWidth": 2,
100+
"pointSize": 5,
101+
"scaleDistribution": {
102+
"type": "linear"
103+
},
104+
"showPoints": "never",
105+
"spanNulls": false,
106+
"stacking": {
107+
"group": "A",
108+
"mode": "none"
109+
},
110+
"thresholdsStyle": {
111+
"mode": "off"
112+
}
113+
},
114+
"mappings": [],
115+
"thresholds": {
116+
"mode": "absolute",
117+
"steps": [
118+
{
119+
"color": "green",
120+
"value": null
121+
}
122+
]
123+
}
124+
},
125+
"overrides": []
126+
},
127+
"gridPos": {
128+
"h": 10,
129+
"w": 24,
130+
"x": 0,
131+
"y": 12
132+
},
133+
"id": 2,
134+
"options": {
135+
"legend": {
136+
"calcs": [],
137+
"displayMode": "list",
138+
"placement": "bottom",
139+
"showLegend": true
140+
},
141+
"tooltip": {
142+
"mode": "single",
143+
"sort": "none"
144+
}
145+
},
146+
"pluginVersion": "11.0.0",
147+
"targets": [
148+
{
149+
"datasource": "mysql",
150+
"format": "table",
151+
"rawQuery": true,
152+
"rawSql": "SELECT DATE(DATE_SUB(ut.day, INTERVAL WEEKDAY(ut.day) DAY)) as time, ut.team_slug as metric, SUM(udm.code_generation_activity_count) as value FROM _tool_copilot_user_teams ut JOIN _tool_copilot_user_daily_metrics udm ON ut.connection_id = udm.connection_id AND ut.scope_id = udm.scope_id AND ut.day = udm.day AND ut.user_id = udm.user_id WHERE ut.connection_id = ${connection_id} AND ut.scope_id = '${scope_id}' AND $__timeFilter(ut.day) GROUP BY time, ut.team_slug ORDER BY time",
153+
"refId": "A"
154+
}
155+
],
156+
"title": "Top Teams by Weekly Suggestions",
157+
"type": "timeseries"
158+
}
159+
],
160+
"refresh": "",
161+
"schemaVersion": 38,
162+
"style": "dark",
163+
"tags": [
164+
"copilot",
165+
"team",
166+
"gh-copilot"
167+
],
168+
"templating": {
169+
"list": [
170+
{
171+
"current": {
172+
"selected": false,
173+
"text": "",
174+
"value": ""
175+
},
176+
"datasource": "mysql",
177+
"definition": "SELECT DISTINCT connection_id FROM _tool_copilot_enterprise_daily_metrics ORDER BY 1",
178+
"hide": 0,
179+
"includeAll": false,
180+
"label": "Connection ID",
181+
"multi": false,
182+
"name": "connection_id",
183+
"options": [],
184+
"query": "SELECT DISTINCT connection_id FROM _tool_copilot_scopes ORDER BY connection_id DESC",
185+
"refresh": 1,
186+
"regex": "",
187+
"skipUrlSync": false,
188+
"sort": 0,
189+
"type": "query"
190+
},
191+
{
192+
"current": {
193+
"selected": false,
194+
"text": "",
195+
"value": ""
196+
},
197+
"datasource": "mysql",
198+
"definition": "SELECT DISTINCT id as scope_id FROM _tool_copilot_scopes WHERE connection_id = ${connection_id} ORDER BY 1",
199+
"hide": 0,
200+
"includeAll": false,
201+
"label": "Scope ID",
202+
"multi": false,
203+
"name": "scope_id",
204+
"options": [],
205+
"query": "SELECT DISTINCT id as scope_id FROM _tool_copilot_scopes WHERE connection_id = ${connection_id} ORDER BY 1",
206+
"refresh": 2,
207+
"regex": "",
208+
"skipUrlSync": false,
209+
"sort": 0,
210+
"type": "query"
211+
}
212+
]
213+
},
214+
"time": {
215+
"from": "now-30d",
216+
"to": "now"
217+
},
218+
"timepicker": {},
219+
"timezone": "",
220+
"title": "GitHub Copilot Adoption by Team and User",
221+
"uid": "github-copilot-adoption-by-team-and-user",
222+
"version": 1,
223+
"weekStart": ""
224+
}

0 commit comments

Comments
 (0)