Skip to content

feat(alert-preview): surface integration_type/integration_name#47

Merged
ysyneu merged 3 commits intomainfrom
feat/alert-preview-ds-fields
Apr 23, 2026
Merged

feat(alert-preview): surface integration_type/integration_name#47
ysyneu merged 3 commits intomainfrom
feat/alert-preview-ds-fields

Conversation

@ysyneu
Copy link
Copy Markdown
Collaborator

@ysyneu ysyneu commented Apr 23, 2026

Summary

Extend the AlertPreview struct returned by query_incident_alerts with the alert's integration metadata so AI-SRE can drill from an incident down to the backing datasource:

  • integration_type — e.g. prometheus, victorialogs, mysql
  • integration_name — concrete datasource name registered in monit-webapi

These are the two fields the monit-query skill reads to construct POST /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 matching DataSource.* pair is marked Deprecated in structs/alert.go).

Test plan

  • TestAlertPreview_CarriesIntegrationFields — struct round-trip
  • TestFetchIncidentAlerts_PreservesIntegrationFields — httptest.Server projection check
  • go test ./... clean on branch

🤖 Generated with Claude Code

ysyneu and others added 2 commits April 23, 2026 10:46
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>
@ysyneu ysyneu changed the title feat(alert-preview): surface data_source_type/data_source_name feat(alert-preview): surface integration_type/integration_name Apr 23, 2026
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>
@ysyneu ysyneu merged commit 23ad085 into main Apr 23, 2026
12 of 13 checks passed
@ysyneu ysyneu deleted the feat/alert-preview-ds-fields branch April 23, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant