Skip to content

Commit 1af54b3

Browse files
Add docs for csv export.mdx (#1123)
Adding documentation for the CSV export feature of Sourcegraph Analytics. --------- Co-authored-by: Maedah Batool <[email protected]>
1 parent b32ae60 commit 1af54b3

File tree

1 file changed

+54
-7
lines changed

1 file changed

+54
-7
lines changed

docs/analytics/index.mdx

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ This solution is available to:
77
- [Sourcegraph Cloud](/cloud) customers
88
- Self-hosted customers that have fully enabled usage telemetry, and that are running a supported version of Sourcegraph (5.9+)
99

10+
[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://cody-analytics.sourcegraph.com) for Cody and Code Search usage data.
11+
Self-hosted customers can also use this service, but they must:
12+
- Upgrade to a supported version of Sourcegraph (5.9+)
13+
- Have fully enabled usage telemetry
14+
- [Enablement instructions](/analytics/cloud#enablement)
15+
1016
For more details on setting up Sourcegraph Analytics, see our [enablement instructions](/analytics/cloud#enablement)
1117

1218
![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/Docs/Sourcegraph-Analytics-2025-01-28.png)
@@ -25,14 +31,14 @@ Learn more about how we think about [the ROI of Sourcegraph in our blog](https:/
2531

2632
### Overview metrics
2733

28-
| Metric | Description |
34+
| **Metric** | **Description** |
2935
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
3036
| Percent of code written by Cody | Percentage of code written by Cody out of all code written during the selected time. [Learn more about this metric.](/analytics/pcw) |
3137
| Lines of code written by Cody | Total lines of code written by Cody during the selected time |
3238

3339
### User metrics
3440

35-
| Metric | Description |
41+
| **Metric** | **Description** |
3642
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
3743
| Total active users | Total number of unique users who have used any Sourcegraph product during the selected time |
3844
| Average daily users | The average number of unique users who use Sourcegraph per day during the selected time |
@@ -48,14 +54,14 @@ Cody-only user metrics
4854

4955
Many of the metrics above are also available for Cody only. However, some user definitions are slightly different:
5056

51-
| User category | Description |
57+
| User category | Description |
5258
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
5359
| Authenticated users | All users signed in to Cody in an editor or interacted with Cody on the web during the selected period. [Read more](/admin/pricing#authenticated-users). |
5460
| Active users | All users who sign in to Cody in an editor or interact with Cody on the web during the period selected. [Read more](/admin/pricing#billable-active-users). |
5561

5662
### Code Search & navigation metrics
5763

58-
| Metric | Description |
64+
| **Metric** | **Description** |
5965
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
6066
| Total in-product searchers | Number of unique users who performed searches using the Sourcegraph search interface during the selected time |
6167
| Total result clicks | Count of times users clicked on search results to view files or other resources during the selected time |
@@ -72,7 +78,7 @@ Many of the metrics above are also available for Cody only. However, some user d
7278

7379
### Autocompletion metrics
7480

75-
| Metric | Description |
81+
| **Metric** | **Description** |
7682
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7783
| Total accepted completions | Count of completions accepted by users during the selected time |
7884
| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion |
@@ -85,7 +91,7 @@ Many of the metrics above are also available for Cody only. However, some user d
8591

8692
### Chat and prompt metrics
8793

88-
| Metric | Description |
94+
| **Metric** | **Description** |
8995
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
9096
| Total chat events | Total number of chat interactions with Cody during the selected time |
9197
| Hours saved by chats | Total hours saved through Cody chat interactions during the selected time , assuming 5 minutes saved per chat |
@@ -101,10 +107,51 @@ Many of the metrics above are also available for Cody only. However, some user d
101107

102108
_As of Sourcegraph version 5.10, commands are being deprecated in favor of our new feature, chat prompts. As a result, if your Sourcegraph instance is running version 5.10 or later, you may see decreased command usage. In the coming weeks, these command metrics will be deprecated and replaced with new prompt metrics on the Chats tab._
103109

104-
| Metric | Description |
110+
| **Metric** | **Description** |
105111
| ----------------------- | ----------------------------------------------------------------------------------------------------------- |
106112
| Total command events | Total number of command executions during the selected time |
107113
| Hours saved by commands | Total hours saved through command executions during the selected time, assuming 5 minutes saved per command |
108114
| Cody commands by day | Daily count of command executions |
109115
| Cody command users | Daily count of command users |
110116
| Most used commands | Ranking of most frequently used Cody commands during the selected time |
117+
118+
### CSV export
119+
120+
You can download underlying user activity data from Sourcegraph Analytics as a CSV export. To do this, click the `Export user-level data` button at the top right of any tab within the portal.
121+
122+
When exporting, you can group the data by:
123+
124+
- User
125+
- User and month
126+
- User and day
127+
- User, day, client, and language
128+
129+
Each row in the CSV represents a user's activity for a specific combination of these groupings (e.g., a particular day, month, client, and/or language). The CSV includes metrics such as searches, code navigation actions, chat conversations, code completions, and more.
130+
131+
#### Important Notes
132+
133+
- Not all billable actions are included: Some Sourcegraph features, such as code monitors and batch changes, are not yet represented as columns in the CSV export. We plan to add these fields soon. If a user engages with these features, their activity may appear as a “blank” row in the export. If a user is listed as an “Active Sourcegraph User” (see column D), but the rest of the row is blank, they performed a billable action that isn’t currently tracked in the CSV
134+
- A zero or blank value in a row can also mean that the user did not perform tracked actions for that specific date, client, or language
135+
136+
| **Column Name** | **Description** |
137+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
138+
| Instance user ID | Unique identifier assigned to each user in the system. |
139+
| User Email | Email address associated with the user's account. For self-hosted instances, customer must sign the user metadata export addendum for this column to populate. |
140+
| Username | User's login identifier, usually matches the username from the auth provider (e.g., GitHub). For self-hosted instances, customer must sign the user metadata export addendum for this column to populate. |
141+
| Active Sourcegraph User | Indicates if the user activity in this row is considered billable. [Read more](/admin/pricing#billable-active-users) |
142+
| Client Name | Name of the client application or interface used. Common values: <br /> - `[IDE_name].cody`: Cody extension interactions from IDEs. <br /> - `server.web`: Interactions with the web interface (e.g., searches, code navigation, insights, and some chat events). Variations like `server.svelte-web` may exist. |
143+
| Timestamp Date (or Month) | When the activity was recorded. |
144+
| Language | Programming language of the interaction. This is only recorded for a subset of events, mostly completion and code navigation, and will therefore be blank for many rows. |
145+
| Searches | Number of search queries performed by the user in the web UI. Searches via other methods (e.g., API) are not captured here. |
146+
| Code Navigation Events | Number of times the user navigated through code structures (e.g., "find references", "go to definition"). |
147+
| Code Insight Views | Number of times a code insight was viewed. |
148+
| Chat Events | Number of Cody chats executed. |
149+
| Command Events | Number of Cody commands executed. |
150+
| Combined Completion Suggestions | Number of code completion suggestions offered. |
151+
| Combined Completion Acceptances | Number of code completions accepted by the user. |
152+
| Total Accepted Char Count | Sum of characters from the user’s accepted code completions (includes both full and partial acceptances). |
153+
| Combined CAR | Completion acceptance rate (ratio of accepted to suggested completions), combined across editors. |
154+
| Weighted CAR | Similar to CAR, but weighted by the number of characters presented in the completion. Gives more weight to accepted completions with more code. |
155+
| Total Characters Written by Cody | Inserted code that Cody generates via chat, prompt responses, accepted autocompletions, or suggestions/fixes. Used as the numerator in the "Percentage of Code Written by Cody" ratio. |
156+
| Total Characters Written | Total new code inserted into the editor (includes both user-generated and Cody-generated characters). Used as the denominator in the "Percentage of Code Written by Cody" ratio. |
157+
| Percentage of Code Written by Cody | Measures Cody's impact: (Total Characters Written by Cody ÷ Total Characters Written) × 100. [Learn more about this metric.](/analytics/pcw) |

0 commit comments

Comments
 (0)