Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions docs/analytics/cloud.mdx → docs/analytics/api.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
# Sourcegraph Cloud Analytics
# Sourcegraph Analytics API

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.

![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/cloud-analytics.png)

## 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.
- Contact your Sourcegraph Technical Advisor or point of contact (or email us at [email protected] 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).

## Data export

Sourcegraph 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.
The Sourcegraph Analytics API is an API that provides programmatic access to your Sourcegraph Analytics data, including usage metrics, user activity, and performance data.

## Access tokens

Expand Down Expand Up @@ -120,7 +105,7 @@ curl -X DELETE https://analytics.sourcegraph.com/api/service-access-tokens/$TOKE

## API reference

Sourcegraph Analytics API is a RESTful API that allows access to Sourcegraph Analytics data. To authenticate to the API, follow the instructions for [token creation](#token-creation).
To authenticate to the API, follow the instructions for [token creation](#token-creation).

Export your access token as an environment variable:

Expand Down
42 changes: 27 additions & 15 deletions docs/analytics/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,41 @@

Enterprise customers can use Sourcegraph Analytics to get a clear view of usage, engagement, performance, and impact.

## Sourcegraph Cloud Analytics
This solution is available to:
Our managed [cloud analytics service](https://analytics.sourcegraph.com) for Cody and Code Search usage data is available for:

- [Sourcegraph Cloud](/cloud) customers
- Self-hosted customers that have fully enabled usage telemetry, and that are running a supported version of Sourcegraph (5.9+)
- [Sourcegraph Enterprise Starter](/pricing/plans/enterprise-starter) customers
- Self-hosted customers that have fully enabled usage telemetry and are running a supported version of Sourcegraph (5.9+)
- [Sourcegraph workspaces](https://workspaces.sourcegraph.com)

To get started, follow our [enablement instructions](#enablement-instructions).

Air-gapped customers can refer to [Sourcegraph Air-Gapped Analytics](/analytics/air-gapped).

### Enablement instructions

#### Self-hosted and Cloud

To enable Sourcegraph Analytics for self-hosted or Cloud instances:

- Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/), or find the email address associated with your existing account.
- Contact your Sourcegraph Technical Advisor or point of contact (or email us at [email protected] 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).

[Sourcegraph Cloud](/cloud) customers can use our managed [cloud analytics service](https://analytics.sourcegraph.com) for Cody and Code Search usage data.
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 workspaces

[Sourcegraph Enterprise Starter](/pricing/plans/enterprise-starter) customers must be a workspace admin to get access to Code Search usage data.
To access Sourcegraph workspaces:

For more details on setting up Sourcegraph Analytics, see our [enablement instructions](/analytics/cloud#enablement)
- Ensure you are an admin of your [Sourcegraph workspace](https://workspaces.sourcegraph.com).
- Sign in to [Sourcegraph Analytics](https://analytics.sourcegraph.com) with the same account you use for your workspace.

![Sourcegraph-cloud-analytics](https://storage.googleapis.com/sourcegraph-assets/Docs/Sourcegraph-Analytics-2025-01-28.png)
### Data export and API

## Air-Gapped Analytics
Sourcegraph Analytics 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.

<Callout type="info">Air-Gapped analytics is an upcoming feature currently in development. If you would like to learn more, please get in touch with your Sourcegraph representative.</Callout>
You can export data directly from the Sourcegraph Analytics web interface, or programmatically via the API. For API access and detailed instructions, see our [Analytics API documentation](/analytics/api).

Air-Gapped customers can view usage metrics in a locally deployed analytics service built on Grafana to see Sourcegraph usage data.
![sourcegraph-analytics](https://storage.googleapis.com/sourcegraph-assets/Docs/Sourcegraph-Analytics-2025-01-28.png)

## Metrics

Expand Down
51 changes: 50 additions & 1 deletion src/data/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6818,7 +6818,56 @@ const redirectsData = [
permanent: true
},


{
source: '/analytics/cloud#access-tokens',
destination: '/analytics/api#access-tokens',
permanent: true
},
{
source: '/analytics/cloud#token-management-apis',
destination: '/analytics/api#token-management-apis',
permanent: true
},
{
source: '/analytics/cloud#enablement-instructions',
destination: '/analytics#enablement-instructions',
permanent: true
},
{
source: '/analytics/cloud#data-export',
destination: '/analytics#data-export-and-api',
permanent: true
},
{
source: '/analytics/cloud#token-creation',
destination: '/analytics/api#token-creation',
permanent: true
},
{
source: '/analytics/cloud#token-listing',
destination: '/analytics/api#token-listing',
permanent: true
},
{
source: '/analytics/cloud#token-revocation',
destination: '/analytics/api#token-revocation',
permanent: true
},
{
source: '/analytics/cloud#api-reference',
destination: '/analytics/api#api-reference',
permanent: true
},
{
source: '/analytics/cloud#csv-export',
destination: '/analytics/api#csv-export',
permanent: true
},
{
source: '/analytics/cloud',
destination: '/analytics',
permanent: true
},
];

const updatedRedirectsData = redirectsData.map(redirect => {
Expand Down