[BUGFIX] pyroscope: scope label lookups to the selected service - #835
Merged
AntoineThebaud merged 1 commit intoOct 5, 2026
Merged
AntoineThebaud merged 1 commit into
AntoineThebaud merged 1 commit into
Conversation
luweglarz
force-pushed
the
fix/pyroscope-scope-label-lookups-to-service
branch
from
September 24, 2026 10:13
3134c75 to
b7a468c
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unescaped selector values can break dropdowns, and both lookup caches can retain results from an earlier time range.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
This PR scopes Pyroscope filter-label lookups to the selected service to avoid expensive unscoped searches.
Changes:
- Builds a service and optional profile-type selector.
- Sends that selector with label lookups and disables lookups when no service is selected.
- Passes the selector through the query editor and filter components.
| File | Description |
|---|---|
pyroscope/src/utils/use-query.ts |
Adds scoped label requests and query keys. |
pyroscope/src/utils/types.ts |
Builds the lookup selector. |
pyroscope/src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.tsx |
Passes service and profile type to filters. |
pyroscope/src/model/pyroscope-client.ts |
Allows matcher arrays in request bodies. |
pyroscope/src/components/LabelValue.tsx |
Passes the selector to value lookups. |
pyroscope/src/components/LabelName.tsx |
Passes the selector to name lookups. |
pyroscope/src/components/Filters.tsx |
Computes and distributes the selector. |
pyroscope/src/components/FilterItem.tsx |
Passes the selector to each dropdown. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
luweglarz
force-pushed
the
fix/pyroscope-scope-label-lookups-to-service
branch
from
October 1, 2026 09:07
b7a468c to
58b0d80
Compare
3 tasks
Signed-off-by: luweglarz <lucas.weglarz@amadeus.com>
luweglarz
force-pushed
the
fix/pyroscope-scope-label-lookups-to-service
branch
from
October 4, 2026 21:30
58b0d80 to
19f8599
Compare
AntoineThebaud
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
The filter dropdowns in the Pyroscope query editor called
LabelNamesandLabelValueswith only a time range and no matchers. Pyroscope narrows the blocks it reads onservice_namealone, so an unscoped lookup scans every block in the range for every service. On a large deployment, one such request fans out into hundreds of internal calls and can exceed the query-backend concurrency limitChanges
computeLabelScopeSelector(service, profileType)builds the selector, andreturns an empty string when no service is set.useLabelNames/useLabelValuessend it asmatchers, include it in the query key, and stay disabled while it is empty.Filterstakes optionalserviceandprofileTypeprops and passes the selector to each filter row; the query editor supplies them.string[]formatchersChecklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.