Repository navigation
[FEATURE] add series color matching functionality in query settings - #985
Open
adrianSepiol wants to merge 2 commits into
Open
adrianSepiol wants to merge 2 commits into
adrianSepiol wants to merge 2 commits into
Conversation
Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
adrianSepiol
requested review from
a team,
AntoineThebaud and
Nexucis
as code owners
December 3, 2026 14:16
adrianSepiol
requested review from
shahrokni
and
a balanced review from Copilot
and removed request for
a team
December 3, 2026 14:16
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Configured regex patterns can catastrophically backtrack during synchronous chart rendering, blocking the UI unless matching time is bounded or a linear-time engine is used.
1 open issue
What changed in this PR
Adds per-series color overrides to Perses TimeSeriesChart, supporting exact or regex display-name matching and exact label matching.
Changes:
- Adds editor controls and runtime matching with first-match precedence.
- Extends TypeScript, CUE, Go SDK, and documentation.
- Adds matcher, palette, editor, schema, and serialization coverage.
| File | Description |
|---|---|
| timeserieschart/src/utils/series-color-matcher.ts | Implements matching and regex caching. |
| timeserieschart/src/utils/series-color-matcher.test.ts | Tests matching and cache behavior. |
| timeserieschart/src/utils/palette-gen.ts | Applies per-series color overrides. |
| timeserieschart/src/utils/palette-gen.test.ts | Tests precedence and palette fallback. |
| timeserieschart/src/TimeSeriesChartPanel.tsx | Passes labels into color selection. |
| timeserieschart/src/time-series-chart-model.ts | Defines matcher and color configuration types. |
| timeserieschart/src/QuerySettingsEditor.tsx | Integrates per-series color editing. |
| timeserieschart/src/QuerySettingsEditor.test.tsx | Tests editor interactions. |
| timeserieschart/src/components/SeriesColorsInput.tsx | Adds editable matcher and color rows. |
| timeserieschart/src/components/ColorModeSelect.tsx | Adds the per-series mode option. |
| timeserieschart/sdk/go/time-series.go | Adds SDK types and matcher serialization. |
| timeserieschart/sdk/go/options_test.go | Tests JSON and YAML serialization. |
| timeserieschart/schemas/time-series.cue | Defines per-series configuration validation. |
| timeserieschart/schemas/tests/valid/time-series-series-colors-name.json | Covers valid name matchers. |
| timeserieschart/schemas/tests/valid/time-series-series-colors-label.json | Covers valid label matchers. |
| timeserieschart/schemas/tests/invalid/time-series-series-colors-mismatched-matcher.json | Covers incomplete label matchers. |
| timeserieschart/schemas/tests/invalid/time-series-series-colors-bad-color.json | Covers invalid color values. |
| timeserieschart/go.mod | Makes YAML a direct test dependency. |
| docs/timeserieschart/model.md | Documents color modes and matcher fields. |
Review effort: Balanced
Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
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
Closes: perses/perses#4406
Adds per-series color overrides to TimeSeriesChart, with exact or regex name matching and exact label matching. Updates the editor, runtime, schema, documentation, Go SDK serialization, and tests.
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes