From b09f8fcd2ae2d0f25f8eeb97c0bcffb5ab53b590 Mon Sep 17 00:00:00 2001
From: Dan Adler <5589410+dadlerj@users.noreply.github.com>
Date: Tue, 12 Nov 2024 13:46:48 -0800
Subject: [PATCH 1/3] add Sourcegraph Analytics docs pages
---
docs/analytics/cloud.mdx | 12 ++++++++
docs/analytics/index.mdx | 55 ++++++++++++++++++++++++++++++++++
docs/analytics/self-hosted.mdx | 15 ++++++++++
src/data/navigation.ts | 9 ++++++
4 files changed, 91 insertions(+)
create mode 100644 docs/analytics/cloud.mdx
create mode 100644 docs/analytics/index.mdx
create mode 100644 docs/analytics/self-hosted.mdx
diff --git a/docs/analytics/cloud.mdx b/docs/analytics/cloud.mdx
new file mode 100644
index 000000000..8162edb7a
--- /dev/null
+++ b/docs/analytics/cloud.mdx
@@ -0,0 +1,12 @@
+# Sourcegraph Analytics for Cloud customers
+
+The following instructions are for Sourcegraph Cloud customers only. Customers that self-host can view our [self-hosted analytics enablement](./self-hosted).
+
+## Enablement instructions
+
+To enable Sourcegraph Analytics:
+
+- Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/), or find the email address associated with your existing account.
+- Get in touch with your Sourcegraph Technical Advisor or point of contact (or email us at support@sourcegraph.com if you don't know your contact), provide them with the email address you used to register above, and ask for access to Sourcegraph Analytics.
+- They will validate your account and link it to your Sourcegraph Enterprise instance's usage metrics.
+- Sign in to [Sourcegraph Analytics](https://analytics.sourcegraph.com).
diff --git a/docs/analytics/index.mdx b/docs/analytics/index.mdx
new file mode 100644
index 000000000..0d81369c8
--- /dev/null
+++ b/docs/analytics/index.mdx
@@ -0,0 +1,55 @@
+# Sourcegraph Analytics
+
+Enterprise customers can use Sourcegraph Analytics to get a clear view of usage, engagement, performance, and impact on a self-serve basis.
+
+## [For Sourcegraph Cloud customers](/analytics/cloud)
+
+[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://analytics.sourcegraph.com) for Cody and Code Search usage data.
+- [Enablement instructions](/analytics/cloud#enablement)
+
+## [For self-hosted customers](/analytics/self-hosted)
+
+Self-hosted customers can use our self-hosted and locally deployed analytics service, built on Grafana, to see Cody and Code Search usage data.
+
+- [Set up instructions](/analytics/self-hosted#set-up)
+- [Updates](/analytics/self-hosted#updates)
+- [Custom metrics](/analytics/self-hosted#custom-metrics)
+
+## Metrics
+
+We provide a set of metrics that can be used to monitor the usage, engagement, performance, and impact of Sourcegraph inside of your enterprise.
+
+Learn more about how we think about [the ROI of Sourcegraph in our blog](https://sourcegraph.com/blog/measuring-the-impact-of-ai-coding-tools).
+
+### Summary metrics
+
+Summary metrics are not yet available.
+
+### Code Search metrics
+
+Code Search metrics are not yet available.
+
+### Cody user metrics
+
+| Metric | Description |
+|--------|-------------|
+| Authenticated 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#authenticated-users). |
+| 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). |
+| Frequency of Usage | Count of users who used Cody n times over the past 30 days. |
+
+### Cody completion metrics
+
+| Metric | Description |
+|--------|-------------|
+| Hour saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion. |
+| Completions and completion users | The number of completions suggested and users who were presented with a completion suggestion. |
+| Completion acceptance rate (CAR) | The percent of completions presented to a user for at least 750ms that were accepted. |
+| Weighted completion acceptance rate (wCAR) | Similar to CAR, but weighted by the number of characters presented in the completion, and only counting those that were fully retained by the user for X minutes after accepating the completion. |
+| Average completion latency (ms) | The average milliseconds of latency before a user is presented with a completion suggestion. |
+
+### Cody chat metrics
+
+| Metric | Description |
+|--------|-------------|
+| Hour saved | The number of hours saved by Cody users, assuming 5 minutes saved per completion. |
+| Chats and chat users | The number of chats and users who chatted with Cody. |
diff --git a/docs/analytics/self-hosted.mdx b/docs/analytics/self-hosted.mdx
new file mode 100644
index 000000000..49dcab4ce
--- /dev/null
+++ b/docs/analytics/self-hosted.mdx
@@ -0,0 +1,15 @@
+# Sourcegraph Analytics for self-hosted customers
+
+The following instructions are for Sourcegraph self-hosted customers only. Customers that use Sourcegraph cloud hosting can view our [cloud analytics enablement](./cloud).
+
+## Set-up instructions
+
+Coming soon.
+
+## Updates
+
+Coming soon.
+
+## Custom metrics
+
+Coming soon.
diff --git a/src/data/navigation.ts b/src/data/navigation.ts
index 0a70c1909..1219585e6 100644
--- a/src/data/navigation.ts
+++ b/src/data/navigation.ts
@@ -254,6 +254,15 @@ export const navigation: NavigationItem[] = [
{ title: "Pricing", href: "/admin/pricing" },
],
},
+ {
+ title: "Sourcegraph Analytics",
+ href: "/analytics",
+ sections: [
+ { title: "Metrics", href: "/analytics#metrics" },
+ { title: "Cloud Analytics", href: "/analytics/cloud" },
+ { title: "Self-hosted Analytics", href: "/analytics/self-hosted" },
+ ],
+ },
{
title: "Sourcegraph Cloud",
href: "/cloud",
From d5f2187ba2e587ed19140df89341a45ac77aeb19 Mon Sep 17 00:00:00 2001
From: Dan Adler <5589410+dadlerj@users.noreply.github.com>
Date: Tue, 12 Nov 2024 13:49:23 -0800
Subject: [PATCH 2/3] fix references to cody analytics
---
docs/admin/pricing.mdx | 2 +-
docs/cody/clients/enable-cody-enterprise.mdx | 21 +++-----------------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/docs/admin/pricing.mdx b/docs/admin/pricing.mdx
index bcf956e31..618bfe5f1 100644
--- a/docs/admin/pricing.mdx
+++ b/docs/admin/pricing.mdx
@@ -48,4 +48,4 @@ A billable active Code Search or Code Intelligence Platform user is one who is s
A user who has accessed a Sourcegraph product is counted as active once they complete an action that represents usage reflected above.
-User counts can be found in the **Site admin** section of the Sourcegraph web application, and Cody-specific usage metrics can be found in the [Cody Analytics service](../cody/clients/enable-cody-enterprise#analytics).
+User counts and more usage metrics can be found in [Sourcegraph Analytics](../analytics).
diff --git a/docs/cody/clients/enable-cody-enterprise.mdx b/docs/cody/clients/enable-cody-enterprise.mdx
index 66da9e1d3..d4d9fffaf 100644
--- a/docs/cody/clients/enable-cody-enterprise.mdx
+++ b/docs/cody/clients/enable-cody-enterprise.mdx
@@ -38,25 +38,10 @@ Sourcegraph account admins have selective control over users' access to Cody Ent
### Analytics
-Cody Analytics are supported with VS Code IDE extension and on the latest versions of JetBrains IDE.
+See our [analytics documentation](../../analytics) for more details.
-Cody Enterprise users get a clear view of usage analytics for their instance on a self-service basis. A separately managed cloud service for Cody analytics handles user auth, gets metrics data from Sourcegraph's BigQuery instance, and visualizes the metrics data.
-
-The following metrics are available for Cody Enterprise users:
-
-| **Metric Type** | **What is measured?** |
-| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| Active users | - Total active users
- Average daily users
- Average no. of days each user used Cody (of last 30 days)
- Cody users by day (last 30 days)
- Cody users by month (last two months)
- Cody users by number of days used |
-| Completions | - Total accepted completions
- Minutes saved per completion
- Hours saved by completions
- Cody completions by day
- Completions acceptance rate
- Weighted completions acceptance rate
- Average completion latency
- Acceptance rate by language
|
-| Chat | - Total chat events
- Minutes saved per chat
- Hours saved by chats
- Cody chats by day |
-| Commands | - Total command events
- Minutes saved per command
- Hours saved by commands
- Cody commands by day
- Most used commands |
-
-To enable Cody Analytics:
-
-- Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/)
-- A user already having an account on Sourcegraph.com gets automatically migrated to Sourcegraph Accounts. Users can sign in to Cody Analytics using their email and password
-- Users without a Sourcegraph.com account, please get in touch with one of our teammates. They can help with both the account setup and assigning instances to specific users
-- Map your user account to a Sourcegraph instance, and this gives you access to Cody's analytics
+- [How to enable Sourcegraph Analytics for Cloud customers](../../analytics/cloud)
+- [How to enable Sourcegraph Analytics for self-hosted customers](../../analytics/self-hosted)
### Multi-repository context
From 23ca848e374091bf75904d5de77ffb63ca5dd6bf Mon Sep 17 00:00:00 2001
From: Dan Adler <5589410+dadlerj@users.noreply.github.com>
Date: Tue, 12 Nov 2024 14:03:08 -0800
Subject: [PATCH 3/3] add images
---
docs/analytics/index.mdx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/analytics/index.mdx b/docs/analytics/index.mdx
index 0d81369c8..118ebc6c5 100644
--- a/docs/analytics/index.mdx
+++ b/docs/analytics/index.mdx
@@ -7,6 +7,8 @@ Enterprise customers can use Sourcegraph Analytics to get a clear view of usage,
[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://analytics.sourcegraph.com) for Cody and Code Search usage data.
- [Enablement instructions](/analytics/cloud#enablement)
+![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png)
+
## [For self-hosted customers](/analytics/self-hosted)
Self-hosted customers can use our self-hosted and locally deployed analytics service, built on Grafana, to see Cody and Code Search usage data.
@@ -15,6 +17,8 @@ Self-hosted customers can use our self-hosted and locally deployed analytics ser
- [Updates](/analytics/self-hosted#updates)
- [Custom metrics](/analytics/self-hosted#custom-metrics)
+![Sourcegraph-self-hosted-analytics](https://storage.googleapis.com/sourcegraph-assets/self-hosted-analytics.png)
+
## Metrics
We provide a set of metrics that can be used to monitor the usage, engagement, performance, and impact of Sourcegraph inside of your enterprise.