@@ -44,8 +44,6 @@ type InvestigationRequest struct {
44
44
// TODO: Add this when we have a new investigation source field InvestigationSourceTypeMCP.
45
45
// InvestigationSource InvestigationSource `json:"investigationSource" gorm:"embedded;embeddedPrefix:investigation_source_"`
46
46
47
- // This field holds metric query input for oncall integration investigations.
48
- // To be removed after migrating to a new more explicit field.
49
47
QueryURL string `json:"queryUrl"`
50
48
51
49
Checks []string `json:"checks" gorm:"serializer:json"`
@@ -58,7 +56,7 @@ type AnalysisStep struct {
58
56
State string `json:"state"`
59
57
// The exit message of the step. Can be empty if the step was successful.
60
58
ExitMessage string `json:"exitMessage"`
61
- // Runtime statistics for this step, stored as JSON in the database
59
+ // Runtime statistics for this step
62
60
Stats map [string ]interface {} `json:"stats,omitempty"`
63
61
}
64
62
@@ -72,18 +70,16 @@ type AnalysisEvent struct {
72
70
73
71
// Interesting: The analysis complete with results that indicate a probable cause for failure.
74
72
type AnalysisResult struct {
75
- Successful bool `json:"successful"`
76
- Interesting bool `json:"interesting"`
77
- Message string `json:"message"`
78
- // Do not put these into the database while we are testing it out. Just used for sending to OnCall.
73
+ Successful bool `json:"successful"`
74
+ Interesting bool `json:"interesting"`
75
+ Message string `json:"message"`
79
76
MarkdownSummary string `json:"-" gorm:"-"`
80
77
Details map [string ]interface {} `json:"details"`
81
78
Events []AnalysisEvent `json:"events,omitempty" gorm:"serializer:json"`
82
79
}
83
80
84
81
// An Analysis struct provides the status and results
85
82
// of running a specific type of check.
86
- // The information is stored in the database.
87
83
type Analysis struct {
88
84
ID uuid.UUID `json:"id" gorm:"primarykey;type:char(36)" validate:"isdefault"`
89
85
CreatedAt time.Time `json:"created" validate:"isdefault"`
@@ -100,11 +96,6 @@ type Analysis struct {
100
96
Title string `json:"title"`
101
97
Steps []AnalysisStep `json:"steps" gorm:"foreignKey:AnalysisID;constraint:OnDelete:CASCADE"`
102
98
Result AnalysisResult `json:"result" gorm:"embedded;embeddedPrefix:result_"`
103
-
104
- // CreateWithID is used to indicate that the analysis should be created with the
105
- // ID in the ID field, rather than generating a new one. This is used by the
106
- // copy command of the mlapi CLI.
107
- CreateWithID bool `json:"-" gorm:"-"`
108
99
}
109
100
110
101
type DatasourceConfig struct {
@@ -141,17 +132,9 @@ type Investigation struct {
141
132
142
133
// GrafanaURL is the Grafana URL to be used for datasource queries
143
134
// for this investigation.
144
- // If missing from a request then the `X-Grafana-URL` header is used.
145
135
GrafanaURL string `json:"grafanaUrl"`
146
136
147
137
// Status describes the state of the investigation (pending, running, failed, or finished).
148
- // This is stored in the db along with the failure reason if the investigation failed.
149
- // It is computed in the AfterUpdate hook on Analyses.
150
- //
151
- // Note this is not tagged as validate:"isdefault" because we want users to be able
152
- // to take an existing investigation, update a field or two, and just POST it to
153
- // create a new investigation. If we included that tag we'd return a 400 here even
154
- // though we just ignore the field, which just adds a slightly annoying step for users.
155
138
Status InvestigationStatus `json:"status"`
156
139
157
140
// FailureReason is a short human-friendly string that explains the reason that the
@@ -367,14 +350,6 @@ func runErrorPatternLogs(ctx context.Context, args RunErrorPatternLogsParams) (*
367
350
return nil , fmt .Errorf ("creating Sift client: %w" , err )
368
351
}
369
352
370
- // // Set default time range to last 30 minutes if not provided
371
- // if args.Start.IsZero() {
372
- // args.Start = time.Now().Add(-30 * time.Minute)
373
- // }
374
- // if args.End.IsZero() {
375
- // args.End = time.Now()
376
- // }
377
-
378
353
// Create the investigation request with ErrorPatternLogs check
379
354
requestData := InvestigationRequest {
380
355
Labels : args .Labels ,
0 commit comments