Feature/grafana irm plugin(#9065) - #9160
Open
Thundercloud12 wants to merge 9 commits into
Open
Thundercloud12 wants to merge 9 commits into
Thundercloud12 wants to merge 9 commits into
Conversation
…ent TestConnection - Seed 2 more real (non-drill) incidents on the dev stack with a real role assignment and multi-label data, closing gaps the original 2-incident fixture never exercised (assignment mapping, per-scope label exclusion). - Add a second e2e scenario proving label-based scope filtering end-to-end. - Update the extractor unit test to use real captured incident data instead of a drill incident's. - Implement TestConnection/TestExistingConnection via a cheap IncidentsService.QueryIncidents call, verified live against the real API.
…filtering The originating feature request only asks for org-wide DORA correlation and never mentions per-team scoping. The label-based per-scope filtering added earlier this session was real and tested, but solved a problem nobody asked for, and config-ui has no generic manual-scope-entry component to build a UI for it on top of. Revert GrafanaIrmScopeConfig/GrafanaIrmOptions/the collector/converter to a single connection-wide scope with no filtering, same shape as incidentio/pagerduty. All incident labels are still collected and stored unconditionally, just no longer used to gate conversion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Backend: add remote_api.go returning the one synthetic scope every connection has (config-ui's data-scope picker has no manual-entry flow to fall back to, so this feeds the standard remote-picker UI a single 'All Incidents' entry instead), wired into impl.go's routes. Frontend: add config-ui/src/plugins/register/grafana_irm (connection form, icon, registration) mirroring incidentio's shape, using the Grafana logo already vendored under grafana/img/. No custom scope-config UI is needed since GrafanaIrmScopeConfig carries no extra fields (Option A). Verified with tsc, eslint, and a production vite build - all clean.
…piCollector subtask The two-subtask design (CollectIncidents + RefreshOpenIncidents) caused three real bugs found via live pipeline testing: a panic, "Re-transform Data" silently deleting resolved incidents, and a genuine full sync also losing data because both subtasks independently wiped the raw table with no coordination between them. pagerduty solves the identical "list new/changed, then refresh still-open" need with DevLake's own FinalizableApiCollector as a single subtask, which prevents these bugs by construction (the framework never builds the "refresh" half on a full sync, and there's only one subtask name for Re-transform Data's filter to strip). Migrated CollectIncidents to that pattern; all existing collector logic (query building, change-detection via a request-scoped header) preserved, just re-wired. Live-verified against a real server: full sync restores all incidents correctly, incremental sync has no regression, and Re-transform Data no longer drops resolved incidents. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…board mapping - Add dedicated Grafana dashboards for MySQL and PostgreSQL dialects - Populate domain ticket.Board in ConvertIncidents to enable board filtering and joins - Update config-ui brand icon with official Grafana flame SVG - Add plugin documentation in backend/plugins/grafana_irm/README.md - Fix struct alignment formatting in models/incident.go
Contributor
Author
|
@klesh please have a look at this feature, it is a very big one majorly I followed incidentio in its structure n all,was raised in one of the issues, I have attached video of the said feature, thank you! |
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.
Summary
This PR introduces a new Grafana IRM (Incident Response & Management) plugin to Apache DevLake, enabling ingestion of Grafana Cloud Incident data into DevLake's standardized domain layer (
issues,issue_labels,issue_assignees,boards, andboard_issues) for tracking incident metrics and correlating with DORA metrics (Change Failure Rate and MTTR).Key Components
Backend Plugin (
backend/plugins/grafana_irm)Data Layer:
_raw_grafana_irm_incidents_tool_grafana_irm_incidents,_tool_grafana_irm_incident_labels,_tool_grafana_irm_incident_assignments, and scopes/connections.Issue(type = INCIDENT),IssueLabel,IssueAssignee, and domainBoard/BoardIssue.Collection Pattern:
helper.NewFinalizableApiCollector.IncidentsService.QueryIncidents) and active/unfinished incident refreshes in a single subtask.API & Scope Management:
remote_api.go).Database Migration:
20260918_add_init_tables.go) registered inregister.go.plugins/table_info_test.goand schema validation tests.Config UI Integration (
config-ui)grafana_irmin the Config UI plugin registry.Dashboards (
grafana/dashboards)grafana-irm.json, plus MySQL and PostgreSQL variants) displaying incident trends, MTTR, severity breakdown, and active incident tracking.Testing
incident_test.go) with CSV fixtures verifying raw → tool → domain conversion.connection_api_test.go).Screenshots
Screencast.from.2026-09-21.22-29-00.mp4
Other Information
Authorization: Bearer <token>).https://<stack>.grafana.net/).pagerduty,incidentio,opsgenie).