From 77114d2560fbba39a12b34b0583414e1ada755b0 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 01/16] 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 d01a75831..94c9d56ea 100644 --- a/src/data/navigation.ts +++ b/src/data/navigation.ts @@ -256,6 +256,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 8fbcd879183c55d5a4884c0838e28af7a6a4888f 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 02/16] fix references to cody analytics --- docs/admin/pricing.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/pricing.mdx b/docs/admin/pricing.mdx index 1f91442b5..5d539c874 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). From 16b27e38e7a1c01d839b733faf58543326b31726 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 03/16] 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. From b91002e87c73992fb1f66243edea8bdf607fa0e0 Mon Sep 17 00:00:00 2001 From: Dan Adler <5589410+dadlerj@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:26:56 -0800 Subject: [PATCH 04/16] Update docs --- docs/analytics/cloud.mdx | 8 +-- docs/analytics/index.mdx | 95 ++++++++++++++++++++++++---------- docs/analytics/self-hosted.mdx | 6 ++- src/data/navigation.ts | 2 +- 4 files changed, 77 insertions(+), 34 deletions(-) diff --git a/docs/analytics/cloud.mdx b/docs/analytics/cloud.mdx index 8162edb7a..591db2b80 100644 --- a/docs/analytics/cloud.mdx +++ b/docs/analytics/cloud.mdx @@ -1,6 +1,8 @@ -# Sourcegraph Analytics for Cloud customers +# Sourcegraph Cloud Analytics -The following instructions are for Sourcegraph Cloud customers only. Customers that self-host can view our [self-hosted analytics enablement](./self-hosted). +The following instructions are for all Sourcegraph Cloud customers, and self-hosted customers who have upgraded to a sufficient version of Sourcegraph (5.9+) and have fully enabled usage telemetry. Customers that self-host can also view our [self-hosted analytics enablement](./self-hosted). + +![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png) ## Enablement instructions @@ -9,4 +11,4 @@ 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). +- Sign in to [Sourcegraph Analytics](https://cody-analytics.sourcegraph.com). diff --git a/docs/analytics/index.mdx b/docs/analytics/index.mdx index 118ebc6c5..ed1878091 100644 --- a/docs/analytics/index.mdx +++ b/docs/analytics/index.mdx @@ -1,23 +1,20 @@ # Sourcegraph Analytics -Enterprise customers can use Sourcegraph Analytics to get a clear view of usage, engagement, performance, and impact on a self-serve basis. +Enterprise customers can use Sourcegraph Analytics to get a clear view of usage, engagement, performance, and impact. -## [For Sourcegraph Cloud customers](/analytics/cloud) +## [Sourcegraph Cloud Analytics](/analytics/cloud) -[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://analytics.sourcegraph.com) for Cody and Code Search usage data. +[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://cody-analytics.sourcegraph.com) for Cody and Code Search usage data. +Self-hosted customers can also use this service, but they must (1) be upgraded to a sufficient version of Sourcegraph (5.9+), (2) fully enable usage telemetry. - [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 Analytics](/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. +Self-hosted customers will soon also be able to use our self-hosted and locally deployed analytics service, built on Grafana, to see Sourcegraph usage data. -- [Set up instructions](/analytics/self-hosted#set-up) -- [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) +This product is in development now. If you would like to learn more, please reach out to your Sourcegraph representative. ## Metrics @@ -25,35 +22,77 @@ We provide a set of metrics that can be used to monitor the usage, engagement, p 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. +### User metrics available -### Code Search metrics +| Metric | Description | +|--------|-------------| +| Total active users | Total number of unique users who have used any Sourcegraph product during the selected time period | +| Average daily users | The average number of unique users who use Sourcegraph per day during the selected time period | +| Average days of activity per user | The average number of days each user actively uses Sourcegraph during the selected time period | +| Daily active users | Number of unique users who used Sourcegraph, by day | +| Weekly active users | Number of unique users who used Sourcegraph, by week | +| Daily users by product | Count of daily users across different Sourcegraph products (Cody, Code Search, Code Insights, etc.) | +| Product usage distribution (by percentage of users) | Percentage breakdown of users across different Sourcegraph product groupings during the selected time period | +| Detailed user activity (top 20 users) | List of the 20 most active users during the selected time period and their usage patterns | +| Frequency of usage | Count of users who used Sourcegraph _n_ times over the past 30 days | + +Cody-only user metrics + +Many of the metrics above are also available for Cody only. However, some user definitions are slightly different: + +| User category | Description | +|---------------|-------------| +| Authenticated users | All users who are signed 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). | -Code Search metrics are not yet available. +### Code Search & navigation metrics -### Cody user metrics +| Metric | Description | +|--------|-------------| +| Total in-product searchers | Number of unique users who performed searches using the Sourcegraph search interface during the selected time period | +| Total result clicks | Count of times users clicked on search results to view files or other resources during the selected time period | +| Total file views | Number of times users viewed individual files through Sourcegraph during the selected time period | +| Daily in-product search activity | Count of search operations performed each day through the Sourcegraph interface | +| Daily search users (in-product and API) | Number of unique users performing searches each day, including both UI and API usage | +| All searches (in-product and API) by type | Breakdown of searches by category (e.g., literal, regex), including both UI and API usage | +| Total code navigation actions | Count of all code navigation operations performed (e.g., go-to-definition, find references) during the selected time period | +| Precise code navigation % | Percentage of code navigation actions that used precise intelligence rather than search-based results, during the selected time period | +| Daily code navigation activity | Count of code navigation operations performed each day | +| Daily code navigation users | Number of unique users utilizing code navigation features each day | +| Precise vs search-based code navigation actions by language | Comparison of precise vs search-based navigation success rates broken down by programming language | + +### Autocompletion 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. | +| Total accepted completions | Count of completions accepted by users during the selected time period | +| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion | +| Completions by day | The number of completions suggested by day and by editor. | +| Completion acceptance rate (CAR) | The percent of completions presented to a user for at least 750ms that were accepted by day, by editor, by day and by month. | +| 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 accepting the completion, by editor, by day and by month. | +| Average completion latency (ms) | The average milliseconds of latency before a user is presented with a completion suggestion, by editor. | +| Acceptance rate by language | CAR and total completion suggestions broken down by editor, during the selected time period | -### Cody completion metrics +### Chat and prompt 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. | +| Total chat events | Total number of chat interactions with Cody during the selected time period | +| Minutes saved per chat | Average time saved per chat interaction with Cody during the selected time period | +| Hours saved by chats | Total hours saved through Cody chat interactions during the selected time period, assuming 5 minutes saved per chat | +| Cody chats by day | Daily count of chat interactions | +| Cody chat users | Daily count of chat users | +| Prompts created, edited, deleted by day | Daily count of prompt management activities, including creation, modification, and removal | +| Users creating, editing, deleting prompts by day | Number of unique users performing prompt management activities each day | + +### Command metrics (deprecated) -### Cody chat metrics +_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._ | 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. | +| Total command events | Total number of command executions during the selected time period | +| Hours saved by commands | Total hours saved through command executions during the selected time period, assuming 5 minutes saved per command | +| Cody commands by day | Daily count of command executions | +| Cody command users | Daily count of command users | +| Most used commands | Ranking of most frequently used Cody commands during the selected time period | \ No newline at end of file diff --git a/docs/analytics/self-hosted.mdx b/docs/analytics/self-hosted.mdx index 49dcab4ce..af34b4979 100644 --- a/docs/analytics/self-hosted.mdx +++ b/docs/analytics/self-hosted.mdx @@ -1,6 +1,8 @@ -# Sourcegraph Analytics for self-hosted customers +# Sourcegraph Self-Hosted Analytics (coming soon) -The following instructions are for Sourcegraph self-hosted customers only. Customers that use Sourcegraph cloud hosting can view our [cloud analytics enablement](./cloud). +Sourcegraph Self-Hosted Analytics is coming soon! Self-hosted customers will be able to view usage metrics in a locally deployed analytics service, built on Grafana. + +This product is in development now. If you would like to learn more, please reach out to your Sourcegraph representative. ## Set-up instructions diff --git a/src/data/navigation.ts b/src/data/navigation.ts index 94c9d56ea..7ba9e9a95 100644 --- a/src/data/navigation.ts +++ b/src/data/navigation.ts @@ -262,7 +262,7 @@ export const navigation: NavigationItem[] = [ sections: [ { title: "Metrics", href: "/analytics#metrics" }, { title: "Cloud Analytics", href: "/analytics/cloud" }, - { title: "Self-hosted Analytics", href: "/analytics/self-hosted" }, + { title: "Self-hosted Analytics (coming soon)", href: "/analytics/self-hosted" }, ], }, { From 37a106d32002921ae67bafd7ce1951a5dd982a8c Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 15:27:54 -0500 Subject: [PATCH 05/16] chore(docs): add callout for database upgrades in TC (#914) Add callout in technical changelog for all versions that upgrade Postgres. --- docs/technical-changelog.mdx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/technical-changelog.mdx b/docs/technical-changelog.mdx index 63a71d1f4..20c3284cf 100644 --- a/docs/technical-changelog.mdx +++ b/docs/technical-changelog.mdx @@ -6,6 +6,11 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 5 +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. +> +> Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! + ## v5.11.6271 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.6271) @@ -35,6 +40,11 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 4 +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. +> +> Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! + ## v5.11.5234 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.5234) @@ -73,6 +83,11 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 3 +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. +> +> Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! + ## v5.11.4013 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.4013) @@ -120,6 +135,11 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 2 +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. +> +> Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! + ## v5.11.3601 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.3601) @@ -145,6 +165,11 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 1 +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. +> +> Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! + ## v5.11.2732 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.2732) @@ -178,7 +203,8 @@ This page documents all notable changes to Sourcegraph. For more detailed change # 5.11 Patch 0 -> Warning: This release updates the database container images from Postgres 12 to Postgres 16, and begins using Wolfi based images. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice! +> Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. +> Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! From 45350e89dc098ca60707ccbd2dbf2b01f2562d4c Mon Sep 17 00:00:00 2001 From: Dan Adler <5589410+dadlerj@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:30:10 -0800 Subject: [PATCH 06/16] Add export note --- docs/analytics/cloud.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/analytics/cloud.mdx b/docs/analytics/cloud.mdx index 591db2b80..8bf30a0c2 100644 --- a/docs/analytics/cloud.mdx +++ b/docs/analytics/cloud.mdx @@ -12,3 +12,7 @@ To enable Sourcegraph Analytics: - 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://cody-analytics.sourcegraph.com). + +## Data export + +Sourcegraph Cloud Analytics also includes a CSV export option with key metrics like number of searches, chats, autocomplete suggestions, completion acceptance rate (CAR %), and more. The data is split by user, day, client/editor, and programming language; perfect for automating retrieval and analyzing data in ways that make the most sense to your organization. \ No newline at end of file From 563c20a032f2e28709ebb5e0d96ce74e85e8d7c7 Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 15:40:14 -0500 Subject: [PATCH 07/16] chore(docs): update dead link in Postgres docs (#915) Update dead link in Postgres docs to external Postgres provider. --- docs/admin/postgres.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/postgres.mdx b/docs/admin/postgres.mdx index e52110eff..021d4ec0a 100644 --- a/docs/admin/postgres.mdx +++ b/docs/admin/postgres.mdx @@ -56,7 +56,7 @@ When running an [external PostgreSQL instance](/admin/external_services/postgres - [Heroku](https://devcenter.heroku.com/articles/upgrading-heroku-postgres-databases) - [EnterpriseDB](https://www.enterprisedb.com/docs/en/9.6/pg/upgrading.html) - [Citus](http://docs.citusdata.com/en/v8.1/admin_guide/upgrading_citus.html) - - [Aiven PostgreSQL](https://help.aiven.io/postgresql/operations/how-to-perform-a-postgresql-in-place-major-version-upgrade) + - [Aiven PostgreSQL](https://aiven.io/docs/platform/concepts/maintenance-window#related-pages) - [Your own PostgreSQL](https://www.postgresql.org/docs/16/pgupgrade.html) 4. Turn Sourcegraph back on connecting to the now-upgraded database. From a95d95bbbe5499c0ca527de1da45ac4d0b1f6a4a Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 15:44:28 -0500 Subject: [PATCH 08/16] chore(docs): remove incorrect customer redirect in aws docker (#916) Remove incorrect customer advisement to not use docker compose and instead use an install script or machine images --- docs/admin/deploy/docker-compose/aws.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/admin/deploy/docker-compose/aws.mdx b/docs/admin/deploy/docker-compose/aws.mdx index d59e2a818..bc6c7ba0c 100644 --- a/docs/admin/deploy/docker-compose/aws.mdx +++ b/docs/admin/deploy/docker-compose/aws.mdx @@ -1,9 +1,5 @@ # Install Sourcegraph on Amazon Web Services (AWS) -> ⚠️ We recommend new users use our [AWS AMI](/admin/deploy/machine-images/aws-oneclick) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team support@sourcegraph.com if they wish to migrate to these deployment models. - - - This guide will take you through how to deploy Sourcegraph with [Docker Compose](https://docs.docker.com/compose/) to a single EC2 instance on Amazon Web Services (AWS). Deploy a Sourcegraph instance with an [AWS AMI](/admin/deploy/machine-images/aws-ami) or [AWS One-Click](/admin/deploy/machine-images/aws-oneclick). (Recommended) From 772d60917a15d0fcca99990eaa631da74b96600d Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 19:29:47 -0500 Subject: [PATCH 09/16] chore(docs): remove incorrect customer redirect in azure docker (#917) Remove incorrect customer advisement to not use docker compose and instead use an install script or machine images --- docs/admin/deploy/docker-compose/azure.mdx | 2 -- docs/admin/deploy/docker-compose/digitalocean.mdx | 2 -- docs/admin/deploy/docker-compose/google_cloud.mdx | 2 -- 3 files changed, 6 deletions(-) diff --git a/docs/admin/deploy/docker-compose/azure.mdx b/docs/admin/deploy/docker-compose/azure.mdx index ad1230e73..f30d1c7e4 100644 --- a/docs/admin/deploy/docker-compose/azure.mdx +++ b/docs/admin/deploy/docker-compose/azure.mdx @@ -1,7 +1,5 @@ # Install Sourcegraph on Azure -> ⚠️ We recommend new users use our [machine image](/admin/deploy/machine-images/) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team support@sourcegraph.com if they wish to migrate to these deployment models. - This guide will take you through how to set up a Sourcegraph instance on an Azure virtual machine with [Docker Compose](https://docs.docker.com/compose/). diff --git a/docs/admin/deploy/docker-compose/digitalocean.mdx b/docs/admin/deploy/docker-compose/digitalocean.mdx index 5027eadbd..66096d1ad 100644 --- a/docs/admin/deploy/docker-compose/digitalocean.mdx +++ b/docs/admin/deploy/docker-compose/digitalocean.mdx @@ -1,7 +1,5 @@ # Install Sourcegraph on DigitalOcean -> ⚠️ We recommend new users use our [machine image](/admin/deploy/machine-images/) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team support@sourcegraph.com if they wish to migrate to these deployment models. - --- This guide will take you through how to deploy a Sourcegraph instance to a single DigitalOcean Droplet with [Docker Compose](https://docs.docker.com/compose/). diff --git a/docs/admin/deploy/docker-compose/google_cloud.mdx b/docs/admin/deploy/docker-compose/google_cloud.mdx index b83d74962..f0bd60ed8 100644 --- a/docs/admin/deploy/docker-compose/google_cloud.mdx +++ b/docs/admin/deploy/docker-compose/google_cloud.mdx @@ -1,7 +1,5 @@ # Install Sourcegraph on Google Cloud -> ⚠️ We recommend new users use our [GCE machine image](/admin/deploy/machine-images/gce) or [script-install](/admin/deploy/single-node/script) instructions, which are easier and offer more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Engineering team support@sourcegraph.com if they wish to migrate to these deployment models. - This guide will take you through how to deploy Sourcegraph with [Docker Compose](https://docs.docker.com/compose/) to a single node running on Google Cloud. ## Configure From 17e523de9914a1fc2c5869c776c364e412e9b2a7 Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 19:31:17 -0500 Subject: [PATCH 10/16] chore(docs): remove another warning for docker (#922) Remove another warning telling customers not to use docker compose in a part of the docs that customers would already be running or have chosen docker compose. --- docs/admin/deploy/docker-compose/aws.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/admin/deploy/docker-compose/aws.mdx b/docs/admin/deploy/docker-compose/aws.mdx index bc6c7ba0c..e11264a0f 100644 --- a/docs/admin/deploy/docker-compose/aws.mdx +++ b/docs/admin/deploy/docker-compose/aws.mdx @@ -2,8 +2,6 @@ This guide will take you through how to deploy Sourcegraph with [Docker Compose](https://docs.docker.com/compose/) to a single EC2 instance on Amazon Web Services (AWS). -Deploy a Sourcegraph instance with an [AWS AMI](/admin/deploy/machine-images/aws-ami) or [AWS One-Click](/admin/deploy/machine-images/aws-oneclick). (Recommended) - ## Configure From 8c530686f403c2d6fec9d612c2029d89d883fc95 Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 19:33:47 -0500 Subject: [PATCH 11/16] chore(docs): remove ref to single image (#921) Remove reference to install script --- docs/admin/deploy/machine-images/aws-oneclick.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/deploy/machine-images/aws-oneclick.mdx b/docs/admin/deploy/machine-images/aws-oneclick.mdx index f5556017e..2d10a4290 100644 --- a/docs/admin/deploy/machine-images/aws-oneclick.mdx +++ b/docs/admin/deploy/machine-images/aws-oneclick.mdx @@ -2,7 +2,7 @@ This page describes how to launch a verified and pre-configured Sourcegraph instance in just ~10 minutes using our one-click CloudFormation template and standard AMIs. -Prefer manually installing on AWS yourself? See our [AMI](/admin/deploy/machine-images/aws-ami) installation options or our [script-install](/admin/deploy/single-node/script) installation options. +Prefer manually installing on AWS yourself? See our [AMI](/admin/deploy/machine-images/aws-ami) installation options. ## Prerequisites From b8773eb58975659120dd8bedd191720006794b41 Mon Sep 17 00:00:00 2001 From: Jacob Pleiness Date: Fri, 24 Jan 2025 19:36:28 -0500 Subject: [PATCH 12/16] chore(docs): add better description for machine image use case (#920) Add better description for the best use case of machine images. Highlight strengths and weaknesses. --- docs/admin/deploy/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/deploy/index.mdx b/docs/admin/deploy/index.mdx index e79d6900c..abe94deb2 100644 --- a/docs/admin/deploy/index.mdx +++ b/docs/admin/deploy/index.mdx @@ -49,7 +49,7 @@ Single-node, self hosted solution for enterprises looking for a simpler, non-Kub Best for enterprises looking for a self-hosted solution on the Cloud provider of their choice. -Customized machine images allow you to spin up a preconfigured Sourcegraph instance with just a few clicks, all in less than 10 minutes. Currently available in the following hosts: +Machine images provide a preconfigured Sourcegraph instance that can be deployed in minutes with minimal effort. While they offer simplicity, they are designed as a standardized solution and do not support customization. Currently available on the following hosts: From 69dcc2255524a89647d7f491c8caea2778a42be5 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Sat, 25 Jan 2025 22:24:04 +0500 Subject: [PATCH 13/16] Fix redirects issue (#924) - https://sourcegraph.slack.com/archives/C05EA9KQUTA/p1737745261526189 --- src/middleware.ts | 219 ++++++++++++++++++++++++++++------------------ 1 file changed, 136 insertions(+), 83 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index ea508acda..9c237a9e8 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,88 +1,141 @@ -import { NextResponse } from 'next/server' -import type { NextRequest } from 'next/server' -import docsConfig from '../docs.config.js' - -const { updatedRedirectsData } = require('./data/redirects.ts'); - -function createRedirectUrl(request: NextRequest, destination: string, path: string): string { - // Handle absolute URLs - if (destination.startsWith('http')) { - // Handle dynamic slug replacements - if (destination.includes(':slug')) { - const slugMatch = path.match(/[^/]+$/) - const slug = slugMatch ? slugMatch[0] : '' - destination = destination.replace(':slug*', slug) - } - // Handle version replacements - if (destination.includes(':version')) { - const versionMatch = path.match(/\d+\.\d+/) - const version = versionMatch ? versionMatch[0] : '' - destination = destination.replace(':version', version) - } - - return destination - } - - // Handle relative paths - const basePath = '/docs' - return destination.startsWith('/') ? - `${request.nextUrl.origin}${basePath}${destination}` : - `${request.nextUrl.origin}${basePath}/${destination}` -} +import type { NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; +import docsConfig from '../docs.config.js'; + +const {updatedRedirectsData} = require('./data/redirects.ts'); + +function createRedirectUrl( + request: NextRequest, + destination: string, + path: string +): string { + // Handle absolute URLs + if (destination.startsWith('http')) { + // Extract version and full path after version + const versionMatch = path.match(/(?:\/v\/|@)(\d+\.\d+)\/(.*)/); + + if (versionMatch) { + const version = versionMatch[1]; + const remainingPath = versionMatch[2]; + + // Find matching redirect for the remaining path + const redirect = updatedRedirectsData.find( + (r: any) => + r.source === `/${remainingPath}` || + r.source === remainingPath + ); + + // If redirect exists, use its destination, otherwise use the remaining path + const finalPath = redirect + ? redirect.destination.replace(/^\//, '') + : remainingPath; + + // Replace placeholders and construct final URL + return destination + .replace(':version', version) + .replace(':slug*', finalPath); + } + + // Handle other cases as before + if (destination.includes(':slug')) { + const slugMatch = path.match(/[^/]+$/); + const slug = slugMatch ? slugMatch[0] : ''; + destination = destination.replace(':slug*', slug); + } + + return destination; + } + // Handle relative paths + const basePath = '/docs'; + return destination.startsWith('/') + ? `${request.nextUrl.origin}${basePath}${destination}` + : `${request.nextUrl.origin}${basePath}/${destination}`; +} export function middleware(request: NextRequest) { - const path = request.nextUrl.pathname - const pathWithoutBase = path.replace('/docs', '') - - // Handle base redirects from redirects.ts - const redirect = updatedRedirectsData.find((r: any) => r.source === pathWithoutBase) - if (redirect) { - return NextResponse.redirect(createRedirectUrl(request, redirect.destination, path)) - } - // Handle version without slug - const versionOnlyMatch = pathWithoutBase.match(/^\/v\/(\d+\.\d+)$/) - if (versionOnlyMatch) { - return NextResponse.redirect(`https://${versionOnlyMatch[1]}.sourcegraph.com/`) - } - // Handle version-specific redirects - if (pathWithoutBase.startsWith(`/v/${docsConfig.DOCS_LATEST_VERSION}/`)) { - return NextResponse.redirect(createRedirectUrl( - request, - `https://sourcegraph.com/docs/:slug*`, - pathWithoutBase - )) - } - if (pathWithoutBase.startsWith(`/@${docsConfig.DOCS_LATEST_VERSION}/`)) { - return NextResponse.redirect(createRedirectUrl( - request, - `https://sourcegraph.com/docs/:slug*`, - pathWithoutBase - )) - } - const versionMatch = pathWithoutBase.match(/^\/v\/(\d+\.\d+)\/(.*)/) - if (versionMatch) { - return NextResponse.redirect(createRedirectUrl( - request, - 'https://:version.sourcegraph.com/:slug*', - pathWithoutBase - )) - } - const atVersionMatch = pathWithoutBase.match(/^\/@(\d+\.\d+)\/(.*)/) - if (atVersionMatch) { - return NextResponse.redirect(createRedirectUrl( - request, - 'https://:version.sourcegraph.com/:slug*', - pathWithoutBase - )) - } - if (pathWithoutBase === '/changelog.rss') - return NextResponse.redirect(createRedirectUrl(request, '/technical-changelog.rss', path)) - - return NextResponse.next() + const path = request.nextUrl.pathname; + const pathWithoutBase = path.replace('/docs', ''); + + // Handle base redirects from redirects.ts + const redirect = updatedRedirectsData.find( + (r: any) => r.source === pathWithoutBase + ); + if (redirect) { + return NextResponse.redirect( + createRedirectUrl(request, redirect.destination, path) + ); + } + + // Handle latest version without path - redirect to main docs + const latestVersionOnlyMatch = pathWithoutBase.match( + `^\/(?:v\/|@)${docsConfig.DOCS_LATEST_VERSION}\/?$` + ); + if (latestVersionOnlyMatch) { + return NextResponse.redirect(`https://sourcegraph.com/docs`); + } + + // Handle version without slug - both /v/X.Y and @X.Y formats (for non-latest versions) + const versionOnlyMatch = pathWithoutBase.match( + /^\/(?:v\/|@)(\d+\.\d+)\/?$/ + ); + if ( + versionOnlyMatch && + versionOnlyMatch[1] !== docsConfig.DOCS_LATEST_VERSION + ) { + return NextResponse.redirect( + `https://${versionOnlyMatch[1]}.sourcegraph.com/` + ); + } + + // Handle version-specific redirects + if (pathWithoutBase.startsWith(`/v/${docsConfig.DOCS_LATEST_VERSION}/`)) { + return NextResponse.redirect( + createRedirectUrl( + request, + `https://sourcegraph.com/docs/:slug*`, + pathWithoutBase + ) + ); + } + if (pathWithoutBase.startsWith(`/@${docsConfig.DOCS_LATEST_VERSION}/`)) { + return NextResponse.redirect( + createRedirectUrl( + request, + `https://sourcegraph.com/docs/:slug*`, + pathWithoutBase + ) + ); + } + const versionMatch = pathWithoutBase.match(/^\/v\/(\d+\.\d+)\/(.*)/); + if (versionMatch) { + return NextResponse.redirect( + createRedirectUrl( + request, + 'https://:version.sourcegraph.com/:slug*', + pathWithoutBase + ) + ); + } + const atVersionMatch = pathWithoutBase.match(/^\/@(\d+\.\d+)\/(.*)/); + + if (atVersionMatch) { + return NextResponse.redirect( + createRedirectUrl( + request, + 'https://:version.sourcegraph.com/:slug*', + pathWithoutBase + ) + ); + } + + if (pathWithoutBase === '/changelog.rss') + return NextResponse.redirect( + createRedirectUrl(request, '/technical-changelog.rss', path) + ); + + return NextResponse.next(); } export const config = { - matcher: [ - '/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)', - ], -} + matcher: ['/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js).*)'] +}; From 5132ec9cad6248f14d4c6cd95f137ab5cbb41f3a Mon Sep 17 00:00:00 2001 From: Petri-Johan Last Date: Mon, 27 Jan 2025 14:03:36 +0200 Subject: [PATCH 14/16] Remove section about modal feature flag that is no longer relevant (#925) This is no longer hidden behind a feature flag --- docs/admin/auth/index.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/admin/auth/index.mdx b/docs/admin/auth/index.mdx index 5a8393b6e..7bce17bf7 100644 --- a/docs/admin/auth/index.mdx +++ b/docs/admin/auth/index.mdx @@ -533,9 +533,3 @@ Usernames from authentication providers are normalized before being used in Sour For example, a user whose external username (according the authentication provider) is `alice_smith@example.com` would have the Sourcegraph username `alice-smith`. If multiple accounts normalize into the same username, separate accounts are still created, but Sourcegraph will add a randomized suffix to the username to ensure uniqueness. - -## Remind users to connect external accounts - -When authorization is activated, users must link their external code host accounts with their Sourcegraph accounts to access private repositories. -To ensure users are aware of any unlinked accounts, enable the external-accounts-modal feature flag. -This prompts users to connect any missing external accounts upon visiting Sourcegraph. From 5836df1ab4786a527d3fc7354817bd94a838b060 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Mon, 27 Jan 2025 21:16:02 +0500 Subject: [PATCH 15/16] Add some feedback and improve structure --- docs/analytics/cloud.mdx | 6 +- docs/analytics/index.mdx | 123 +++++++++++++++++---------------- docs/analytics/self-hosted.mdx | 8 ++- src/data/navigation.ts | 4 +- 4 files changed, 73 insertions(+), 68 deletions(-) diff --git a/docs/analytics/cloud.mdx b/docs/analytics/cloud.mdx index 8bf30a0c2..f268fd106 100644 --- a/docs/analytics/cloud.mdx +++ b/docs/analytics/cloud.mdx @@ -1,6 +1,6 @@ # Sourcegraph Cloud Analytics -The following instructions are for all Sourcegraph Cloud customers, and self-hosted customers who have upgraded to a sufficient version of Sourcegraph (5.9+) and have fully enabled usage telemetry. Customers that self-host can also view our [self-hosted analytics enablement](./self-hosted). +The following instructions are for all Sourcegraph Cloud and self-hosted customers who have upgraded to a sufficient version of Sourcegraph (5.9+) and fully enabled telemetry usage. Customers that self-host can also view our [self-hosted analytics enablement](/self-hosted). ![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png) @@ -9,10 +9,10 @@ The following instructions are for all Sourcegraph Cloud customers, and self-hos 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. +- Contact 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://cody-analytics.sourcegraph.com). ## Data export -Sourcegraph Cloud Analytics also includes a CSV export option with key metrics like number of searches, chats, autocomplete suggestions, completion acceptance rate (CAR %), and more. The data is split by user, day, client/editor, and programming language; perfect for automating retrieval and analyzing data in ways that make the most sense to your organization. \ No newline at end of file +Sourcegraph Cloud Analytics also includes a CSV export option with key metrics like the number of searches, chats, autocomplete suggestions, completion acceptance rate (CAR %), and more. The data is split by user, day, client/editor, and programming language, perfect for automating retrieval and analyzing data in ways that make the most sense to your organization. diff --git a/docs/analytics/index.mdx b/docs/analytics/index.mdx index ed1878091..8f33247a7 100644 --- a/docs/analytics/index.mdx +++ b/docs/analytics/index.mdx @@ -2,97 +2,100 @@ Enterprise customers can use Sourcegraph Analytics to get a clear view of usage, engagement, performance, and impact. -## [Sourcegraph Cloud Analytics](/analytics/cloud) +## Sourcegraph Cloud Analytics [Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://cody-analytics.sourcegraph.com) for Cody and Code Search usage data. -Self-hosted customers can also use this service, but they must (1) be upgraded to a sufficient version of Sourcegraph (5.9+), (2) fully enable usage telemetry. +Self-hosted customers can also use this service, but they must + +Upgrade to a supported version of Sourcegraph (5.9+) +Have fully enabled usage telemetry. - [Enablement instructions](/analytics/cloud#enablement) ![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png) -## [Self-Hosted Analytics](/analytics/self-hosted) +## Self-Hosted Analytics -Self-hosted customers will soon also be able to use our self-hosted and locally deployed analytics service, built on Grafana, to see Sourcegraph usage data. +Self-hosted customers will soon be able to use our self-hosted and locally deployed analytics service, built on Grafana, to see Sourcegraph usage data. -This product is in development now. If you would like to learn more, please reach out to your Sourcegraph representative. +This product is in development now. If you would like to learn more, please contact your Sourcegraph representative. ## 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. +We provide a set of metrics that can be used to monitor Sourcegraph usage, engagement, performance, and impact within 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). ### User metrics available -| Metric | Description | -|--------|-------------| -| Total active users | Total number of unique users who have used any Sourcegraph product during the selected time period | -| Average daily users | The average number of unique users who use Sourcegraph per day during the selected time period | -| Average days of activity per user | The average number of days each user actively uses Sourcegraph during the selected time period | -| Daily active users | Number of unique users who used Sourcegraph, by day | -| Weekly active users | Number of unique users who used Sourcegraph, by week | -| Daily users by product | Count of daily users across different Sourcegraph products (Cody, Code Search, Code Insights, etc.) | -| Product usage distribution (by percentage of users) | Percentage breakdown of users across different Sourcegraph product groupings during the selected time period | -| Detailed user activity (top 20 users) | List of the 20 most active users during the selected time period and their usage patterns | -| Frequency of usage | Count of users who used Sourcegraph _n_ times over the past 30 days | +| Metric | Description | +| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| Total active users | Total number of unique users who have used any Sourcegraph product during the selected time | +| Average daily users | The average number of unique users who use Sourcegraph per day during the selected time | +| Average days of activity per user | The average number of days each user actively uses Sourcegraph during the selected time | +| Daily active users | Number of unique users who used Sourcegraph by day | +| Weekly active users | Number of unique users who used Sourcegraph by week | +| Daily users by product | Count of daily users across different Sourcegraph products (Cody, Code Search, Code Insights, etc.) | +| Product usage distribution (by percentage of users) | Percentage breakdown of users across different Sourcegraph product groupings during the selected time | +| Detailed user activity (top 20 users) | List of the 20 most active users during the selected time and their usage patterns | +| Frequency of usage | Count of users who used Sourcegraph _n_ times over the past 30 days | Cody-only user metrics Many of the metrics above are also available for Cody only. However, some user definitions are slightly different: -| User category | Description | -|---------------|-------------| -| Authenticated users | All users who are signed 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). | +| User category | Description | +| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 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). | +| 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). | ### Code Search & navigation metrics -| Metric | Description | -|--------|-------------| -| Total in-product searchers | Number of unique users who performed searches using the Sourcegraph search interface during the selected time period | -| Total result clicks | Count of times users clicked on search results to view files or other resources during the selected time period | -| Total file views | Number of times users viewed individual files through Sourcegraph during the selected time period | -| Daily in-product search activity | Count of search operations performed each day through the Sourcegraph interface | -| Daily search users (in-product and API) | Number of unique users performing searches each day, including both UI and API usage | -| All searches (in-product and API) by type | Breakdown of searches by category (e.g., literal, regex), including both UI and API usage | -| Total code navigation actions | Count of all code navigation operations performed (e.g., go-to-definition, find references) during the selected time period | -| Precise code navigation % | Percentage of code navigation actions that used precise intelligence rather than search-based results, during the selected time period | -| Daily code navigation activity | Count of code navigation operations performed each day | -| Daily code navigation users | Number of unique users utilizing code navigation features each day | -| Precise vs search-based code navigation actions by language | Comparison of precise vs search-based navigation success rates broken down by programming language | +| Metric | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| Total in-product searchers | Number of unique users who performed searches using the Sourcegraph search interface during the selected time | +| Total result clicks | Count of times users clicked on search results to view files or other resources during the selected time | +| Total file views | Number of times users viewed individual files through Sourcegraph during the selected time | +| Daily in-product search activity | Count of search operations performed each day through the Sourcegraph interface | +| Daily search users (in-product and API) | Number of unique users performing searches each day, including both UI and API usage | +| All searches (in-product and API) by type | Breakdown of searches by category (e.g., literal, regex), including both UI and API usage | +| Total code navigation actions | Count of all code navigation operations performed (e.g., go-to-definition, find references) during the selected time period | +| Precise code navigation % | Percentage of code navigation actions that used precise intelligence rather than search-based results during the selected time | +| Daily code navigation activity | Count of code navigation operations performed each day | +| Daily code navigation users | Number of unique users utilizing code navigation features each day | +| Precise vs. search-based code navigation actions by language | Comparison of precise vs. search-based navigation success rates broken down by programming language | ### Autocompletion metrics -| Metric | Description | -|--------|-------------| -| Total accepted completions | Count of completions accepted by users during the selected time period | -| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion | -| Completions by day | The number of completions suggested by day and by editor. | -| Completion acceptance rate (CAR) | The percent of completions presented to a user for at least 750ms that were accepted by day, by editor, by day and by month. | -| 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 accepting the completion, by editor, by day and by month. | -| Average completion latency (ms) | The average milliseconds of latency before a user is presented with a completion suggestion, by editor. | -| Acceptance rate by language | CAR and total completion suggestions broken down by editor, during the selected time period | +| Metric | Description | +| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Total accepted completions | Count of completions accepted by users during the selected time | +| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion | +| Completions by day | The number of completions suggested by day and by editor. | +| Completion acceptance rate (CAR) | The percent of completions presented to a user for at least 750ms accepted by day, the editor, day, and month. | +| Weighted completion acceptance rate (wCAR) | Similar to CAR, but weighted by the number of characters presented in the completion, and only counting those fully retained by the user for X minutes after accepting the completion, by the editor, day, and month. | +| Average completion latency (ms) | The average milliseconds of latency before a user is presented with a completion suggestion by an editor. | +| Acceptance rate by language | CAR and total completion suggestions broken down by editor during the selected time | ### Chat and prompt metrics -| Metric | Description | -|--------|-------------| -| Total chat events | Total number of chat interactions with Cody during the selected time period | -| Minutes saved per chat | Average time saved per chat interaction with Cody during the selected time period | -| Hours saved by chats | Total hours saved through Cody chat interactions during the selected time period, assuming 5 minutes saved per chat | -| Cody chats by day | Daily count of chat interactions | -| Cody chat users | Daily count of chat users | -| Prompts created, edited, deleted by day | Daily count of prompt management activities, including creation, modification, and removal | -| Users creating, editing, deleting prompts by day | Number of unique users performing prompt management activities each day | +| Metric | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| Total chat events | Total number of chat interactions with Cody during the selected time | +| Minutes saved per chat | Average time saved per chat interaction with Cody during the selected time | +| Hours saved by chats | Total hours saved through Cody chat interactions during the selected time , assuming 5 minutes saved per chat | +| Cody chats by day | Daily count of chat interactions | +| Cody chat users | Daily count of chat users | +| Prompts created, edited, and deleted by day | Daily count of prompt management activities, including creation, modification, and removal | +| Users creating, editing, and deleting prompts by day | Number of unique users performing prompt management activities each day | ### Command metrics (deprecated) -_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._ +_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._ -| Metric | Description | -|--------|-------------| -| Total command events | Total number of command executions during the selected time period | -| Hours saved by commands | Total hours saved through command executions during the selected time period, assuming 5 minutes saved per command | -| Cody commands by day | Daily count of command executions | -| Cody command users | Daily count of command users | -| Most used commands | Ranking of most frequently used Cody commands during the selected time period | \ No newline at end of file +| Metric | Description | +| ----------------------- | ----------------------------------------------------------------------------------------------------------- | +| Total command events | Total number of command executions during the selected time | +| Hours saved by commands | Total hours saved through command executions during the selected time, assuming 5 minutes saved per command | +| Cody commands by day | Daily count of command executions | +| Cody command users | Daily count of command users | +| Most used commands | Ranking of most frequently used Cody commands during the selected time | diff --git a/docs/analytics/self-hosted.mdx b/docs/analytics/self-hosted.mdx index af34b4979..d067ead0c 100644 --- a/docs/analytics/self-hosted.mdx +++ b/docs/analytics/self-hosted.mdx @@ -1,8 +1,10 @@ -# Sourcegraph Self-Hosted Analytics (coming soon) +# Sourcegraph Self-Hosted Analytics -Sourcegraph Self-Hosted Analytics is coming soon! Self-hosted customers will be able to view usage metrics in a locally deployed analytics service, built on Grafana. +This feature is not yet available. Coming soon. -This product is in development now. If you would like to learn more, please reach out to your Sourcegraph representative. +Sourcegraph Self-Hosted Analytics is coming soon! Self-hosted customers can view usage metrics in a locally deployed analytics service built on Grafana. + +This product is in development now. If you would like to learn more, please contact your Sourcegraph representative. ## Set-up instructions diff --git a/src/data/navigation.ts b/src/data/navigation.ts index 7ba9e9a95..3e19aa4d1 100644 --- a/src/data/navigation.ts +++ b/src/data/navigation.ts @@ -262,9 +262,9 @@ export const navigation: NavigationItem[] = [ sections: [ { title: "Metrics", href: "/analytics#metrics" }, { title: "Cloud Analytics", href: "/analytics/cloud" }, - { title: "Self-hosted Analytics (coming soon)", href: "/analytics/self-hosted" }, + { title: "Self-hosted Analytics", href: "/analytics/self-hosted" }, ], - }, + }, { title: "Sourcegraph Cloud", href: "/cloud", From bcbb1750b3692bf1cc85f86ac08c59f1f7c6ac5b Mon Sep 17 00:00:00 2001 From: Dan Adler <5589410+dadlerj@users.noreply.github.com> Date: Mon, 27 Jan 2025 09:47:17 -0800 Subject: [PATCH 16/16] fix --- docs/analytics/cloud.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/analytics/cloud.mdx b/docs/analytics/cloud.mdx index f268fd106..aba096ad8 100644 --- a/docs/analytics/cloud.mdx +++ b/docs/analytics/cloud.mdx @@ -1,6 +1,6 @@ # Sourcegraph Cloud Analytics -The following instructions are for all Sourcegraph Cloud and self-hosted customers who have upgraded to a sufficient version of Sourcegraph (5.9+) and fully enabled telemetry usage. Customers that self-host can also view our [self-hosted analytics enablement](/self-hosted). +The following instructions are for all Sourcegraph Cloud and self-hosted customers who have upgraded to a sufficient version of Sourcegraph (5.9+) and fully enabled usage telemetry. Customers that self-host can also view our [self-hosted analytics enablement](/self-hosted). ![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png)