sourcegraph/internal/cmd/search-blitz
Camden Cheek 1e3b643e94
Search blitz: updates for 3rd-party users (#64375)
The goal of this PR is to make search blitz usable for customers who
want to run it against their instance for continuous performance
analysis.

Specifically, this does two things:
1) Enables configuring the set of queries to run with the
`SEARCH_BLITZ_QUERY_FILE` env var
2) Packages the image in our standard format so we can publish it
2024-08-12 16:13:06 +00:00
..
attribution search-blitz: add attribution search (#55051) 2023-07-18 11:01:24 +02:00
scripts search-blitz: run list-tags in build help output (#56359) 2023-09-05 16:05:01 +02:00
.gitignore search-blitz: build outside of docker (#55057) 2023-07-19 12:20:27 +02:00
api.go search: Incorporate search blitz (#19567) 2021-03-30 09:28:24 -06:00
attribution.graphql search-blitz: adjust limit for snippetAttribution to match gateway (#64119) 2024-07-29 12:10:11 +02:00
BUILD.bazel Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
client.go chore(search): update search API call sites to set the version explicitly (#63782) 2024-07-12 10:01:47 +02:00
config_test.go Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
config.go Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
Dockerfile search-blitz: build outside of docker (#55057) 2023-07-19 12:20:27 +02:00
image_test.yaml Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
main.go Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
prometheus.go search-blitz: remove group (#55065) 2023-07-19 12:20:49 +02:00
protocol.go search-blitz: add attribution search (#55051) 2023-07-18 11:01:24 +02:00
queries_dogfood.txt search-blitz: add queries for megarepo on k8s.sgdev.org (#34789) 2022-05-02 19:50:48 +02:00
queries.txt Search: add 'AND' queries to search blitz (#59679) 2024-01-17 11:55:15 -08:00
query.go search-blitz: add attribution search (#55051) 2023-07-18 11:01:24 +02:00
README.md Search blitz: updates for 3rd-party users (#64375) 2024-08-12 16:13:06 +00:00
search.graphql chore(search): update search API call sites to set the version explicitly (#63782) 2024-07-12 10:01:47 +02:00
stream_client.go search-blitz: add attribution search (#55051) 2023-07-18 11:01:24 +02:00

Search-Blitz

The purpose of Search-Blitz is to provide a baseline for our search performance. Search-Blitz calls the stream and GraphQL APIs for typical queries in regular intervals. Sourcegraph recognizes the Search-Blitz's User-Agent and sends metrics to Prometheus.

The dashboard is accessible on Grafana, section "Sentinel queries".

In addition to the dashboard that we ship with Sourcegraph, Search-Blitz is deployed with a dedicated instance of Prometheus and Grafana.

How to track a query

Add the query to queries.txt.

For attribution search add a .txt file to the attribution directory.

A custom set of queries can be provided at runtime by pointing to a query file with the SEARCH_BLITZ_QUERY_FILE env var.

How to deploy

  1. Merge your changes to main

  2. Build and upload a new docker image:

    ./scripts/build.sh <next-version, e.g. 0.0.2>
    
  3. Update the image tag in deploy-sourcegraph-cloud

  4. (Optional) Apply the new manifest

kubectl apply -f ./configure/search-blitz

How to access Search-Blitz's dedicated Grafana

kubectl port-forward search-blitz-0 3000:3000 -n monitoring

open http://localhost:3000