[do not merge] dsconfig: base - #213
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a dsconfig.json schema for the Prometheus data source and adds supporting generated schema artifacts, enabling downstream consumers (including agents) to understand/configure the datasource fields in a consistent way.
Changes:
- Added
pkg/schema/dsconfig.jsonplus generated schema artifacts (schema.gen.json,settings.gen.json,settings.examples.gen.json). - Added a Go settings model and a conformance test using
github.com/grafana/dsconfig/schema. - Updated the frontend build to copy schema artifacts into the built plugin output, and bumped version/changelog.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
webpack.config.ts |
Copies dsconfig/schema artifacts into the built plugin dist/ output. |
pkg/schema/dsconfig.json |
Adds the Prometheus dsconfig schema definition (fields/groups/relationships/instructions). |
pkg/schema/schema.gen.json |
Adds generated “combined” schema artifact (v0alpha1). |
pkg/schema/settings.gen.json |
Adds generated settings JSON schema artifact. |
pkg/schema/settings.examples.gen.json |
Adds generated settings examples artifact. |
pkg/schema/models/settings.go |
Adds Go model representing dsconfig settings fields (json tags used for conformance). |
pkg/schema/dsconfig_test.go |
Adds dsconfig conformance test wiring + artifact generation hook. |
go.mod |
Adds dsconfig schema dependencies and updates kube-openapi + sigs.k8s.io/yaml. |
go.sum |
Updates sums for newly introduced/updated Go dependencies. |
package.json |
Bumps root package version to 13.2.0. |
packages/grafana-prometheus-datasource/package.json |
Bumps workspace package version to 13.2.0. |
CHANGELOG.md |
Adds 13.2.0 entry describing the dsconfig schema/artifacts addition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
b146513 to
3af9be2
Compare
jcolladokuri
left a comment
There was a problem hiding this comment.
a few nits, I think it would be nice if we could keep consistently either _ or . for target naming.
Since most of what we have in place works with . I'd lean towards keeping it that way, but open to other ideas!
itsmylife
left a comment
There was a problem hiding this comment.
It looks good to me. But I asked one question. I can approve once I got the answer. Also conflicts has to be resolved.
|
Also, could you please add documentation around schema, dsconfig etc? If I'd add a new settings option how I'd add that to schema, which command to run? |
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com> Signed-off-by: Jocelyn Collado-Kuri <jcolladokuri@icloud.com>
Summary
This PR adds the datasource configuration schema for the datasource. With the schema consumers such as llm agents, provisioning agents, etc will understand the shape and meta data about the datasource configuration.
Read more at