-
Notifications
You must be signed in to change notification settings - Fork 25
feat(observability-lib): compatibility with grafana 11.6 and 12+ #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(observability-lib): compatibility with grafana 11.6 and 12+ #1784
Conversation
|
👋 Atrax1, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the observability library to maintain compatibility with Grafana versions 11.6 and 12+. The changes primarily involve updating dependencies to newer versions of the Grafana Foundation SDK and adapting the code to use updated type names and constants from the new SDK version.
Changes:
- Added logic to fetch and preserve existing dashboard UIDs when deploying to Grafana
- Updated type references to match the Grafana Foundation SDK's new naming conventions
- Upgraded dependencies including the Grafana Foundation SDK, resty, cobra, and testify libraries
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| observability-lib/grafana/dashboard.go | Adds dashboard UID lookup logic to preserve existing dashboard identifiers during deployment |
| observability-lib/grafana/alerts.go | Updates type references to match new SDK naming conventions (removes custom type aliases in favor of SDK types) |
| observability-lib/go.mod | Updates dependency versions for Grafana SDK and other libraries to support Grafana 11.6+ |
Comments suppressed due to low confidence (1)
observability-lib/go.mod:3
- The Go version 1.24.5 specified is from the future. As of January 2025, Go 1.24 has not been released. Please verify and use a valid, released Go version (e.g., 1.23.x or earlier).
go 1.24.5
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| dashboardFound, _, err := grafanaClient.GetDashboardByName(*o.Dashboard.Title) | ||
| if err != nil { | ||
| return err |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error from GetDashboardByName is returned directly without context. Consider wrapping the error with additional information about what operation failed, such as 'failed to fetch existing dashboard by name: %w'.
| return err | |
| return fmt.Errorf("failed to fetch existing dashboard by name %q: %w", *o.Dashboard.Title, err) |
✅ API Diff Results - No breaking changes |
2c670e6 to
cc23f1a
Compare
41094fd to
9e91e53
Compare
Compatibility with Grafana v11.6 and v12.1+
Added a call if existing dashboard name is present to allow for update instead of re-create. This behaviour changed since new version of grafana. This call wasnt necesary before.
Alert builder now requires at build time the rule group so we added a new option on DeployToGrafana Option to allow keeping same behaviour as we had by enabling
RuleGroupFromDashboardas the new default is the panel nameRequires
Supports