Skip to content

telemetry: log query data in public argument

Warren Gifford requested to merge jp/logquery into main

Created by: limitedmage

Fixes #22587 (closed)

Query metrics will be logged as public arguments for ALL users

Verbatim search queries will be logged only for unauthenticated users on Sourcegraph.com after sanitizing by removing following filters which I think are the ones with the highest potential of leakage:

  • repo
  • file
  • rev
  • repohasfile
  • context
  • message

This will include aliased versions of these filters (e.g. r for repo) and negated versions (-repo and -r).

The filters themselves will still be logged, with the value of the filter redacted. For example:

test context:codename repo:^github.com/foo/bar$ file:baz rev:test repohasfile:foobar message:here

will be transformed into

test context:[REDACTED] repo:[REDACTED] file:[REDACTED] rev:[REDACTED] repohasfile:[REDACTED] message:[REDACTED]

Merge request reports

Loading