Code AI platform with Code Search & Cody
Go to file
Robert Lin 775091b2c6
instrumentation: set X-Trace to trace ID, X-Trace-URL to trace URL, add X-Trace-Span (#53259)
This allows us to return `X-Trace` and `X-Trace-Span` from Cody Gateway
with the shared HTTP instrumentation helper, which will help linking up
traces in case GCP tracing doesn't work out, and also help with
debugging customer instances that talk to Cody Gateway. Outside of
Sourcegraph core we don't have access to conf so setting this to a URL
doesn't make as much sense, and there seems to be a somewhat
pre-existing standard in Jaeger to set `x-trace` to a trace ID (?), and
`X-Trace-Span` just tacks onto that with a bit more detail (for Cody
Gateway locally, `x-trace` will point to the entire trace, would be nice
to have the span ID as well).

In Sourcegraph core, this means that we now can't set the URL to
`X-Trace` as we've done before. Instead, we now set it to `X-Trace-URL`,
and send both in responses. There appears to be no references to
`X-Trace` that expects an URL, so I think we should be good here -
streaming search uses a field on its responses.

Related: #53025 

## Test plan

With `?trace=1` in both Cody chat and search, I now get something like
the following:

<img width="708" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/23356519/b56f63e5-ad3e-4aad-8108-3aaa6af6f67e">

The "View trace" still works as expected, and the link and the headers
point to the same trace.
2023-06-09 11:33:11 -07:00
.aspect Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
.buildkite ci: clean all containers. clean up disk if over 85% (#53138) 2023-06-09 10:38:56 +02:00
.github Setup release protector for 5.1 (#53132) 2023-06-09 07:41:53 +01:00
.vscode app: Add system tray (#51213) 2023-04-28 11:59:27 +01:00
client Add app specific (simplified) routing schema (#53257) 2023-06-09 14:58:34 -03:00
cmd migrator: extract non-cli specifics from cli package (#53247) 2023-06-09 18:51:56 +01:00
dev migrator: extract non-cli specifics from cli package (#53247) 2023-06-09 18:51:56 +01:00
doc instrumentation: set X-Trace to trace ID, X-Trace-URL to trace URL, add X-Trace-Span (#53259) 2023-06-09 11:33:11 -07:00
docker-images scip-ctags: allow for creating multiple identifiers from one (#52957) 2023-06-08 10:36:05 -04:00
enterprise cody-gateway: set TTL on actor caches (#53265) 2023-06-09 11:32:47 -07:00
internal instrumentation: set X-Trace to trace ID, X-Trace-URL to trace URL, add X-Trace-Span (#53259) 2023-06-09 11:33:11 -07:00
lib migrator: extract non-cli specifics from cli package (#53247) 2023-06-09 18:51:56 +01:00
migrations Analytics background worker - counts & codeowners (#53150) 2023-06-09 12:58:52 +00:00
monitoring lib/errors: document redaction, upgrade error deps (#53109) 2023-06-09 08:39:40 -07:00
schema Search: enable cross-repo ranking by default (#53031) 2023-06-07 08:15:36 -07:00
src-tauri app: update settings page (#53172) 2023-06-08 15:43:51 -07:00
testing shell: /bin/bash -> /usr/bin/env bash (#53000) 2023-06-06 13:51:55 +01:00
third_party bazel: update gazelle repos (#52936) 2023-06-05 17:25:19 +02:00
third-party-licenses Gerrit Batch Changes (#52647) 2023-06-05 18:51:44 +00:00
ui/assets bazel: Bazel build browser extension + code-intel-extensions (#51135) 2023-05-02 03:33:52 -07:00
wolfi-images executors: Add Maven to Bundled Executor (#53105) 2023-06-07 11:23:44 -06:00
wolfi-packages wolfi: update http-server-stabilizer to 1.1.0 (#52932) 2023-06-05 20:07:53 +02:00
.bazel_fix_commands.json bazel: add command sets that uses bazel under the hood (#48460) 2023-03-02 11:31:51 +01:00
.bazelignore bazel: disable build-ts and build client/cody with Bazel (#51404) 2023-05-05 03:57:10 -07:00
.bazeliskrc chore: update to Aspect CLI 5.4.11 (#52533) 2023-05-27 08:40:03 +02:00
.bazelrc Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
.bazelversion Update bazel to 6.1.1 (#50472) 2023-04-11 10:51:21 +02:00
.browserslistrc web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
.dockerignore web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
.editorconfig chore: Add .lua to editorconfig. (#44267) 2022-11-11 15:25:32 +08:00
.eslintignore bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
.eslintrc.js bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
.gitattributes bazel: Build syntax-highlighter (#48703) 2023-03-08 19:08:09 +08:00
.gitignore nix: reorganizing (#52273) 2023-05-31 16:20:32 +01:00
.graphqlrc.yml
.hadolint.yaml bump comby version to 1.7.1 (#35830) 2022-05-20 20:12:01 -07:00
.mailmap mailmap: add entries for Eric and Renovate (#50966) 2023-04-25 09:42:22 +02:00
.mocharc.js build: still need BAZEL_BINDIR for webpack_bundle custom rule (#48796) 2023-03-07 20:02:11 -08:00
.npmrc pnpm: remove update notifier message (#51630) 2023-05-10 08:53:39 +02:00
.percy.yml Update browser extention installation detection logic on web (#32449) 2022-03-14 23:29:39 +06:00
.prettierignore bazel: decouple web application bundle from integration tests modules (#51560) 2023-05-10 06:47:56 +00:00
.stylelintignore rework plugin structure and implement frontside blogpost (#46883) 2023-02-15 11:49:51 +02:00
.stylelintrc.json web: drop bootstrap depenedency (#41401) 2022-09-07 03:11:26 -07:00
.tool-versions ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
.trivyignore ci: ignore benign CVE-2021-43816 in prometheus (#31069) 2022-02-11 16:49:10 +00:00
babel.config.jest.js bazel: fix the web application bundle in Bazel (#50383) 2023-04-10 21:16:12 -07:00
babel.config.js bazel: fix the web application bundle in Bazel (#50383) 2023-04-10 21:16:12 -07:00
BUILD.bazel bzl: remove default_tags from oci_push rules (#52996) 2023-06-06 12:32:45 +02:00
CHANGELOG.app.md Add v2023.5.30 (#52785) 2023-06-01 15:09:18 -06:00
CHANGELOG.md instrumentation: set X-Trace to trace ID, X-Trace-URL to trace URL, add X-Trace-Span (#53259) 2023-06-09 11:33:11 -07:00
CODENOTIFY nix: update pnpm hash (#51512) 2023-05-05 12:51:59 +00:00
CONTRIBUTING.md Docs: Fix docs page link in main CONTRIBUTING.md (#45160) 2022-12-05 14:57:45 +01:00
deps.bzl lib/errors: document redaction, upgrade error deps (#53109) 2023-06-09 08:39:40 -07:00
doc.go
eslint-relative-formatter.js bazel: implement custom ESLint Bazel rule (#52062) 2023-05-22 04:05:45 -07:00
flake.lock nix: reorganizing (#52273) 2023-05-31 16:20:32 +01:00
flake.nix nix: develop uses non static binaries (#52927) 2023-06-07 08:36:09 +02:00
gen.go chore: Update go-mockgen (#44305) 2022-11-11 19:24:00 +00:00
go.mod zoekt: update to sourcegraph/zoekt@88def9b1ed (#53088) 2023-06-07 15:19:03 +00:00
go.sum zoekt: update to sourcegraph/zoekt@88def9b1ed (#53088) 2023-06-07 15:19:03 +00:00
graphql-schema-linter.config.js
gulpfile.js web: drop legacy GraphQL schema generator (#45945) 2022-12-25 18:10:20 -08:00
jest.config.base.js bazel: wildcard jest tests (#49282) 2023-03-17 03:38:49 -07:00
jest.config.js tests: use glob for jest projects field (#29681) 2022-01-13 01:11:52 -08:00
jest.snapshot-resolver.js bazel: wildcard jest tests (#49282) 2023-03-17 03:38:49 -07:00
LICENSE update licensing language (#25620) 2021-10-04 15:40:59 +01:00
LICENSE.apache
LICENSE.enterprise
lighthouserc.js web: migrate from yarn to pnpm (#46143) 2023-01-11 19:50:09 -08:00
linter_deps.bzl bazel: add unparam nogo linter (#50730) 2023-04-18 10:03:35 +00:00
mockgen.temp.yaml Embeddings: remove context detection index (#53131) 2023-06-08 10:57:39 -07:00
mockgen.test.yaml Gerrit Batch Changes (#52647) 2023-06-05 18:51:44 +00:00
mockgen.yaml mocks: Reorganize mock definitions into multiple files (#36967) 2022-06-27 20:59:16 +00:00
nogo_config.json bazel: add depguard as a nogo linter (#50585) 2023-04-13 14:19:45 +02:00
package.json ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
pnpm-lock.yaml ci: improve pnpm dedupe CI check (#52741) 2023-06-01 06:02:20 +00:00
pnpm-workspace.yaml cody: development branch (#49761) 2023-03-23 20:41:11 +01:00
postcss.config.js extensibility: add featured extensions to registry (#21665) 2021-06-10 13:55:20 -04:00
prettier.config.js clean up Cody CSS to increase shareability and improve display in web app (#50279) 2023-04-03 12:29:05 -07:00
README.md update readme and docs index for 5.0 (#49988) 2023-03-24 21:48:46 -06:00
renovate.json chore: add test plans to bot and release tool PRs (#31351) 2022-02-22 07:53:25 -08:00
SECURITY.md
service-catalog.yaml lib/servicecatalog: init to distribute catalog (#46999) 2023-01-26 17:22:27 -08:00
sg.config.yaml own: remove manually assigned owner button (#53052) 2023-06-08 10:56:25 -07:00
shell.nix nix: develop uses non static binaries (#52927) 2023-06-07 08:36:09 +02:00
stamp_tags.bzl Switch to OCI/Wolfi based image (#52693) 2023-06-02 12:12:52 +02:00
svgo.config.js Performance: Optimize static SVG assets with SVGO (#26285) 2021-10-27 15:27:36 +01:00
tsconfig.all.json Cody: Add E2E test setup based on Playwright (#52071) 2023-05-19 19:11:52 +02:00
tsconfig.base.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00
tsconfig.eslint.json web: fix pnpm-lock issue (#47478) 2023-02-09 22:04:31 -08:00
WORKSPACE bazel: update gazelle repos (#52936) 2023-06-05 17:25:19 +02:00

DocsContributingTwitterDiscord

Build status Scorecard Latest release Discord Contributors


Sourcegraph makes it easy to read, write, and fix code—even in big, complex codebases.

  • Code search: Search all of your repositories across all branches and all code hosts.
  • Code intelligence: Navigate code, find references, see code owners, trace history, and more.
  • Fix and refactor: Roll out large-scale changes to many repositories at once and track big migrations.

Getting started



Development

Refer to the Developing Sourcegraph guide to get started.

Documentation

The doc directory has additional documentation for developing and understanding Sourcegraph:

License

This repository contains both OSS-licensed and non-OSS-licensed files. We maintain one repository rather than two separate repositories mainly for development convenience.

All files in the enterprise and client/web/src/enterprise fall under LICENSE.enterprise.

The remaining files fall under the Apache 2 license. Sourcegraph OSS is built only from the Apache-licensed files in this repository.