From b8aafdc03d745e5d4e50c0d3e9f67d69c8b6ad9f Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 24 Jun 2025 12:26:25 -0700 Subject: [PATCH 1/3] LoC and file count insights --- docs/code_insights/types/inventory-stats.mdx | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/code_insights/types/inventory-stats.mdx diff --git a/docs/code_insights/types/inventory-stats.mdx b/docs/code_insights/types/inventory-stats.mdx new file mode 100644 index 000000000..ac71d1b7f --- /dev/null +++ b/docs/code_insights/types/inventory-stats.mdx @@ -0,0 +1,51 @@ +# Inventory Stats + +

Learn about your project's inventory stats type of Code Insights.

+ +An inventory stats code insight lets you track code inventory metrics such as file counts, lines of code, and language usage trends in your repositories. Sourcegraph Code Search Enterprise users can track these metrics across all repositories in their organization. + +To create an inventory stats code insight: + +- Navigate to the Code Insights tab from the Sourcegraph instance +- Click on the **Create insight** button +- Select **Inventory Stats** as the type of insight +- Choose your list of target repositories on which you want to perform an insight +- Next, pick the inventory metrics you want to track, like lines of code, file size, and file count +- Finally, add a **title** and **granularity** of the insight +- And click **Create code insight** once you are done + +While configuring these fields, you can also see a live preview of the insight on the right side of the page. + +After you have created the insight, you can view it on the **Code Insights** tab. + +![inventory-stats](https://storage.googleapis.com/sourcegraph-assets/Docs/inventory-stats-insights-0625.png) + +Now, you can perform all the actions you can on other Code Insights, such as editing, filtering, sharing, and deleting. + +## Inventory environment variables + +We have made some changes to the inventory environment variables for our self-hosted customers. Cloud customers are not impacted by this change. + +If you are a self-hosted Sourcegraph Enterprise user, we have moved the inventory environment variables into the **Site configuration** settings in your **Site admin** page. You can find it under the **inventory** section. + +Here's a list of all the inventory environment variables and their default values: + +- `USE_ENHANCED_LANGUAGE_DETECTION: "disableEnhancedLanguageDetection"`: defaults to false +- `GET_INVENTORY_GIT_SERVER_CONCURRENCY: "gitServerConcurrency"`: defaults to 4 +- `GET_INVENTORY_REDIS_CONCURRENCY: "redisConcurrency"`: defaults to 20 +- `GET_INVENTORY_MAX_INV_IN_MEMORY: "maxInventoryInMemory"`: defaults to 1000 +- `GET_INVENTORY_TIMEOUT: "timeoutInMinutes"`: defaults to 5 + +Here's an example from the site configuration section: + +```json +"inventory" : { + "disableEnhancedLanguageDetection": false, + "gitServerConcurrency": 4, + "redisConcurrency": 20, + "maxInventoryInMemory": 1000, + "timeoutInMinutes": 5 +} +``` + +To accommodate default values in your Site configuration vs. environment variables, the positive `USE_ENHANCED_LANGUAGE_DETECTION` env var has been changed to the negative `disableEnhancedLanguageDetection`. From 3d2c54b32dd31b7f3910385ec3ec17a62ffba1a6 Mon Sep 17 00:00:00 2001 From: Marc <7050295+marcleblanc2@users.noreply.github.com> Date: Tue, 24 Jun 2025 14:52:36 -0600 Subject: [PATCH 2/3] Add note about closing Grafana port 3370 by default on Docker deployments (#1129) Add note about closing Grafana port 3370 by default on Docker deployments, as per https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/1204 ## Pull Request approval You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel. Co-authored-by: Maedah Batool --- docs/admin/updates/docker_compose.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/admin/updates/docker_compose.mdx b/docs/admin/updates/docker_compose.mdx index a485cfe3f..b48960817 100644 --- a/docs/admin/updates/docker_compose.mdx +++ b/docs/admin/updates/docker_compose.mdx @@ -11,6 +11,10 @@ For upgrade procedures or general info about sourcegraph versioning see the link > > ***If the notes indicate a patch release exists, target the highest one.*** +## v6.3 patch 1 + +- Grafana's port 3370 is no longer open by default for unauthenticated access for Docker Compose and Pure Docker deployments. Admins can still access Grafana by logging in to their Sourcegraph instance, navigating to the Site Admin page, then clicking Monitoring from the left navigation menu. If customers require port 3370 to be open, see [[PR 1204](https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/1204/files)] for insight on how to add this port to their `docker-compose.override.yaml` file. + ## v6.2.2553 ### Known issues From fb0b75a1f1187f60b57009dc4d0d17c9b19d8fe7 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 24 Jun 2025 16:00:33 -0700 Subject: [PATCH 3/3] Add feedback from the team --- docs/code_insights/types/inventory-stats.mdx | 31 ++++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/code_insights/types/inventory-stats.mdx b/docs/code_insights/types/inventory-stats.mdx index ac71d1b7f..80224d4e7 100644 --- a/docs/code_insights/types/inventory-stats.mdx +++ b/docs/code_insights/types/inventory-stats.mdx @@ -24,19 +24,24 @@ Now, you can perform all the actions you can on other Code Insights, such as edi ## Inventory environment variables -We have made some changes to the inventory environment variables for our self-hosted customers. Cloud customers are not impacted by this change. +Inventory environment variables have been moved into site configuration. This impacts any self-hosted customer using these environment variables. Cloud customers are not impacted by this change. -If you are a self-hosted Sourcegraph Enterprise user, we have moved the inventory environment variables into the **Site configuration** settings in your **Site admin** page. You can find it under the **inventory** section. +If you are a self-hosted Sourcegraph Enterprise user, we have moved the inventory environment variables into the **inventory** section of the **Site configuration** settings in your **Site admin** page. -Here's a list of all the inventory environment variables and their default values: +Here's a list oI the Inventory environment variables and their new site configuration settings, with default values: -- `USE_ENHANCED_LANGUAGE_DETECTION: "disableEnhancedLanguageDetection"`: defaults to false -- `GET_INVENTORY_GIT_SERVER_CONCURRENCY: "gitServerConcurrency"`: defaults to 4 -- `GET_INVENTORY_REDIS_CONCURRENCY: "redisConcurrency"`: defaults to 20 -- `GET_INVENTORY_MAX_INV_IN_MEMORY: "maxInventoryInMemory"`: defaults to 1000 -- `GET_INVENTORY_TIMEOUT: "timeoutInMinutes"`: defaults to 5 +- `USE_ENHANCED_LANGUAGE_DETECTION` ==> `"disableEnhancedLanguageDetection"` + - defaults to `false` +- `GET_INVENTORY_GIT_SERVER_CONCURRENCY` ==> `"gitServerConcurrency"` + - defaults to `4` +- `GET_INVENTORY_REDIS_CONCURRENCY` ==> `"redisConcurrency"` + - defaults to `20` +- `GET_INVENTORY_MAX_INV_IN_MEMORY` ==> `"maxInventoryInMemory"` + - defaults to `1000` +- `GET_INVENTORY_TIMEOUT` ==> `"timeoutInMinutes"` + - defaults to `5` -Here's an example from the site configuration section: +Here's an example of the site configuration section: ```json "inventory" : { @@ -49,3 +54,11 @@ Here's an example from the site configuration section: ``` To accommodate default values in your Site configuration vs. environment variables, the positive `USE_ENHANCED_LANGUAGE_DETECTION` env var has been changed to the negative `disableEnhancedLanguageDetection`. + +There is a new environment variable for managing `worker` resources when processing Inventory insights: + +```json +INSIGHTS_INVENTORY_BATCH_SIZE +``` + +This environment variable controls the number of repositories to process in a single batch for inventory insights in the code insights worker. It affects memory usage while processing repos. Lower number is less memory used. It does not affect the speed of the process.