Search API instrumentation scope mislabeled
Summary
Discovered while debugging gitlab-com/gl-infra/production#7671 (comment 1084086908)
Labels for some searches in the API do not have the appropriate instrumentation labels applied.
I think this affects projects and groups searches.
Steps to reproduce
- Make an API call to project commits search (http://gdk.test:3000/api/v4/projects/6/search?scope=commits&search=test&per_page=50&ref=master)
- Note which instrumentation is filled out, it should be
- type: basic
- scope: commits
- level: project
What is the current bug behavior?
- type: advanced (in kibana logs but it should be basic based on gitaly + elasticsearch call count)
- scope: commits
- level: global
What is the expected correct behavior?
- type: basic
- scope: commits
- level: project
Possible fixes
search_service
is called with additional_params
when creating the @results
variable but it is not memoized so when it's called during the metrics creation, the additional_params
are not included
Edited by Terri Chu