Repository navigation
[BUGFIX] Update plugin Selector functions for new datasource.Selector union type - #857
Merged
Merged
Conversation
asergeant01
force-pushed
the
fix/datasource-variable-selector
branch
from
October 5, 2026 10:29
d677ae6 to
d08a61c
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Every changed module references constructor APIs absent from its pinned Perses dependency, preventing compilation.
Review effort: Balanced
Findings: 12
Open (12)
Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New Pinned Perses version lacks required selector APIs · New
What changed in this PR
Updates all datasource Go SDKs for static and variable selector construction.
Changes:
- Uses
datasource.NewStaticSelectorfor concrete datasources. - Adds
VariableSelectorwrappers for variable references.
| File | Description |
|---|---|
alertmanager/sdk/go/datasource/datasource.go |
Updates Alertmanager selector helpers. |
clickhouse/sdk/go/datasource/datasource.go |
Updates ClickHouse selector helpers. |
greptimedb/sdk/go/datasource/datasource.go |
Updates GreptimeDB selector helpers. |
jaeger/sdk/go/datasource/datasource.go |
Updates Jaeger selector helpers. |
json/sdk/go/datasource/datasource.go |
Updates JSON selector helpers. |
loki/sdk/go/datasource/datasource.go |
Updates Loki selector helpers. |
opensearch/sdk/go/datasource/datasource.go |
Updates OpenSearch selector helpers. |
prometheus/sdk/go/datasource/datasource.go |
Updates Prometheus selector helpers. |
pyroscope/sdk/go/datasource/datasource.go |
Updates Pyroscope selector helpers. |
splunk/sdk/go/datasource/datasource.go |
Updates Splunk selector helpers. |
tempo/sdk/go/datasource/datasource.go |
Updates Tempo selector helpers. |
victorialogs/sdk/go/datasource/datasource.go |
Updates VictoriaLogs selector helpers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
asergeant01
force-pushed
the
fix/datasource-variable-selector
branch
from
October 7, 2026 07:49
d08a61c to
4667f46
Compare
Nexucis
reviewed
Oct 7, 2026
asergeant01
force-pushed
the
fix/datasource-variable-selector
branch
from
October 7, 2026 08:50
4667f46 to
4063f8a
Compare
asergeant01
force-pushed
the
fix/datasource-variable-selector
branch
from
October 7, 2026 10:15
4063f8a to
dca53e5
Compare
… union type The upstream perses/perses change (perses/perses#4545) replaces the single datasource.Selector struct with an explicit union type: StaticSelector for concrete {kind, name} references, and VariableSelector for "$var" references. Update all 12 plugin datasource packages: - Selector(name) now calls datasource.NewStaticSelector(PluginKind, name) - Add VariableSelector(name) that calls datasource.NewVariableSelector(name) Callers that previously passed a "$var" string to Selector() should switch to VariableSelector() so the variable reference is emitted correctly in JSON and YAML output. Note: this change requires bumping github.com/perses/perses in go.mod once perses/perses#4545 is merged and tagged. Signed-off-by: Alan Sergeant <alan.sergeant@sap.com>
asergeant01
force-pushed
the
fix/datasource-variable-selector
branch
from
October 7, 2026 10:23
dca53e5 to
0ba147b
Compare
Nexucis
approved these changes
Oct 7, 2026
Nexucis
left a comment
Member
There was a problem hiding this comment.
awesome ! Thank you @asergeant01
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
This PR is the plugins-side complement to perses/perses#4545, which replaces the single
datasource.Selectorstruct with an explicit union type:ObjectSelector— the concrete{"kind": "…", "name": "…"}formVariableSelector— the"$var"variable reference formSelector— a union; exactly one of the above must be setPreviously, all 12 plugin
Selector(name string)functions constructed&datasource.Selector{Kind: PluginKind, Name: name}directly. This meant that passing"$myDatasource"always produced the structured-object form in JSON/YAML output, which Perses cannot resolve at runtime because no datasource is literally named"$myDatasource".Changes
All 12 plugin
datasourcepackages are updated uniformly:Selector(name string)now callsdatasource.NewSelector(PluginKind, name)— for concrete datasource references.VariableSelector(name string)is added, callingdatasource.NewVariableSelector(name)— for variable references. Callers that previously passed a"$var"string toSelector()should switch toVariableSelector().Screenshots
N/A — Go SDK only.
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
N/A