feat(alert-preview): surface integration_type/integration_name#47
Merged
feat(alert-preview): surface integration_type/integration_name#47
Conversation
query_incident_alerts used to strip data_source_type/data_source_name when projecting upstream alerts to AlertPreview, leaving AI-SRE's monit-query skill without the fields it needs to route /monit/query/rows calls. Add both to AlertPreview and the upstream anonymous Items struct, and copy them through the mapping loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Upstream Alert struct marks DataSourceType/Name as deprecated in favor of Integration.*; align AlertPreview with the preferred names so downstream consumers (AI-SRE monit-query skill) read the non-deprecated field names. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
IntegrationType/Name are two runes longer than DataSourceType/Name, so the json tag column drifts. Re-run gofmt to restore alignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Summary
Extend the
AlertPreviewstruct returned byquery_incident_alertswith the alert's integration metadata so AI-SRE can drill from an incident down to the backing datasource:integration_type— e.g.prometheus,victorialogs,mysqlintegration_name— concrete datasource name registered in monit-webapiThese are the two fields the
monit-queryskill reads to constructPOST /monit/query/rows. The upstream Alert struct already carries both (fc-event/structs/alert.go); this PR is a pass-through projection.Naming follows the non-deprecated
Integration.*convention from fc-event (the matchingDataSource.*pair is marked Deprecated in structs/alert.go).Test plan
TestAlertPreview_CarriesIntegrationFields— struct round-tripTestFetchIncidentAlerts_PreservesIntegrationFields— httptest.Server projection checkgo test ./...clean on branch🤖 Generated with Claude Code