Skip to content

Commit 221cc88

Browse files
Merge pull request #28727 from dgoodwin/drop-interval-loc-msg
TRT-1610: Intervals, move over to new schema, finally...
2 parents efa2ab6 + d87fae9 commit 221cc88

File tree

84 files changed

+2793
-3992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2793
-3992
lines changed

e2echart/e2e-chart-template.html

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -77,151 +77,151 @@ <h5 class="modal-title">Resource</h5>
7777
});
7878

7979
function isOperatorAvailable(eventInterval) {
80-
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
81-
eventInterval.tempStructuredMessage.annotations["condition"] === "Available" &&
82-
eventInterval.tempStructuredMessage.annotations["status"] === "False";
80+
return eventInterval.locator.type === "ClusterOperator" &&
81+
eventInterval.message.annotations["condition"] === "Available" &&
82+
eventInterval.message.annotations["status"] === "False";
8383
}
8484

8585
function isOperatorDegraded(eventInterval) {
86-
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
87-
eventInterval.tempStructuredMessage.annotations["condition"] === "Degraded" &&
88-
eventInterval.tempStructuredMessage.annotations["status"] === "True";
86+
return eventInterval.locator.type === "ClusterOperator" &&
87+
eventInterval.message.annotations["condition"] === "Degraded" &&
88+
eventInterval.message.annotations["status"] === "True";
8989
}
9090

9191
function isOperatorProgressing(eventInterval) {
92-
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
93-
eventInterval.tempStructuredMessage.annotations["condition"] === "Progressing" &&
94-
eventInterval.tempStructuredMessage.annotations["status"] === "True";
92+
return eventInterval.locator.type === "ClusterOperator" &&
93+
eventInterval.message.annotations["condition"] === "Progressing" &&
94+
eventInterval.message.annotations["status"] === "True";
9595
}
9696

9797
// When an interval in the openshift-etcd namespace had a reason of LeaderFound, LeaderLost,
98-
// LeaderElected, or LeaderMissing, tempSource was set to 'EtcdLeadership'.
98+
// LeaderElected, or LeaderMissing, source was set to 'EtcdLeadership'.
9999
function isEtcdLeadership(eventInterval) {
100-
return eventInterval.tempSource === 'EtcdLeadership';
100+
return eventInterval.source === 'EtcdLeadership';
101101

102102
}
103103

104104
function isPodLog(eventInterval) {
105-
if (eventInterval.tempSource === 'PodLog') {
105+
if (eventInterval.source === 'PodLog') {
106106
return true
107107
}
108-
return eventInterval.tempSource === 'EtcdLog';
108+
return eventInterval.source === 'EtcdLog';
109109

110110
}
111111

112112
function isInterestingOrPathological(eventInterval) {
113-
return eventInterval.tempSource === 'KubeEvent' && eventInterval.tempStructuredMessage.annotations["pathological"] === "true";
113+
return eventInterval.source === 'KubeEvent' && eventInterval.message.annotations["pathological"] === "true";
114114
}
115115

116116
function isE2EFailed(eventInterval) {
117-
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Failed") {
117+
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Failed") {
118118
return true
119119
}
120120
return false
121121
}
122122

123123
function isE2EFlaked(eventInterval) {
124-
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Flaked") {
124+
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Flaked") {
125125
return true
126126
}
127127
return false
128128
}
129129

130130
function isE2EPassed(eventInterval) {
131-
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Passed") {
131+
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Passed") {
132132
return true
133133
}
134134
return false
135135
}
136136

137137
function isGracefulShutdownActivity(eventInterval) {
138-
return (eventInterval.tempSource === "APIServerGracefulShutdown")
138+
return (eventInterval.source === "APIServerGracefulShutdown")
139139
}
140140

141141
function isEndpointConnectivity(eventInterval) {
142-
if (eventInterval.tempStructuredMessage.reason !== "DisruptionBegan" && eventInterval.tempStructuredMessage.reason !== "DisruptionSamplerOutageBegan") {
142+
if (eventInterval.message.reason !== "DisruptionBegan" && eventInterval.message.reason !== "DisruptionSamplerOutageBegan") {
143143
return false
144144
}
145-
if (eventInterval.tempSource === "Disruption") {
145+
if (eventInterval.source === "Disruption") {
146146
return true
147147
}
148-
if (eventInterval.tempStructuredLocator.keys["namespace"] === "e2e-k8s-service-lb-available") {
148+
if (eventInterval.locator.keys["namespace"] === "e2e-k8s-service-lb-available") {
149149
return true
150150
}
151-
if (eventInterval.tempStructuredLocator.keys.has("route")) {
151+
if (eventInterval.locator.keys.has("route")) {
152152
return true
153153
}
154154

155155
return false
156156
}
157157

158158
function isNodeState(eventInterval) {
159-
return eventInterval.tempSource === "NodeState"
159+
return eventInterval.source === "NodeState"
160160
}
161161

162162
function isCloudMetrics(eventInterval) {
163-
return eventInterval.tempSource === "CloudMetrics";
163+
return eventInterval.source === "CloudMetrics";
164164
}
165165

166166
function isAlert(eventInterval) {
167-
return eventInterval.tempSource === "Alert"
167+
return eventInterval.source === "Alert"
168168
}
169169

170170
function pathologicalEvents(item) {
171-
if (item.tempStructuredMessage.annotations["pathological"] === "true") {
172-
if (item.tempStructuredMessage.annotations["interesting"] === "true") {
173-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pathological known)`, "PathologicalKnown"];
171+
if (item.message.annotations["pathological"] === "true") {
172+
if (item.message.annotations["interesting"] === "true") {
173+
return [buildLocatorDisplayString(item.locator), ` (pathological known)`, "PathologicalKnown"];
174174
} else {
175-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pathological new)`, "PathologicalNew"];
175+
return [buildLocatorDisplayString(item.locator), ` (pathological new)`, "PathologicalNew"];
176176
}
177177
}
178178
// TODO: hack that can likely be removed when we get to structured intervals for these
179179
// Always show pod sandbox events even if they didn't make it to pathological
180-
if (item.tempStructuredMessage.annotations["interesting"] === "true" && item.tempStructuredMessage.humanMessage.includes("pod sandbox")) {
181-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod sandbox)`, "PodSandbox"];
180+
if (item.message.annotations["interesting"] === "true" && item.message.humanMessage.includes("pod sandbox")) {
181+
return [buildLocatorDisplayString(item.locator), ` (pod sandbox)`, "PodSandbox"];
182182
}
183183
}
184184

185185
function podLogs(item) {
186186
if (item.level == "Warning") {
187-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogWarning"];
187+
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogWarning"];
188188
}
189189
if (item.level == "Error") {
190-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogError"];
190+
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogError"];
191191
}
192-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogInfo"];
192+
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogInfo"];
193193
}
194194

195195

196196
const rePhase = new RegExp("(^| )phase/([^ ]+)")
197197
function nodeStateValue(item) {
198198
let roles = ""
199-
if (item.tempStructuredMessage.annotations.hasOwnProperty('roles')) {
200-
roles = item.tempStructuredMessage.annotations.roles
199+
if (item.message.annotations.hasOwnProperty('roles')) {
200+
roles = item.message.annotations.roles
201201
}
202202

203-
if (item.tempStructuredMessage.reason === 'NotReady') {
204-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (${roles})`, "NodeNotReady"]
203+
if (item.message.reason === 'NotReady') {
204+
return [buildLocatorDisplayString(item.locator), ` (${roles})`, "NodeNotReady"]
205205
}
206-
let m = item.tempStructuredMessage.annotations.phase;
207-
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (${roles})`, m];
206+
let m = item.message.annotations.phase;
207+
return [buildLocatorDisplayString(item.locator), ` (${roles})`, m];
208208
}
209209

210210
function etcdLeadershipLogsValue(item) {
211211

212212
// If source is isEtcdLeadership, the term is always there.
213-
const term = item.tempStructuredMessage.annotations['term']
213+
const term = item.message.annotations['term']
214214

215215
// We are only charting the intervals with a node.
216-
const nodeVal = item.tempStructuredLocator.keys['node']
216+
const nodeVal = item.locator.keys['node']
217217

218218
// Get etcd-member value (this will be present for a leader change).
219-
let etcdMemberVal = item.tempStructuredLocator.keys['etcd-member'] || ''
219+
let etcdMemberVal = item.locator.keys['etcd-member'] || ''
220220
if (etcdMemberVal.length > 0) {
221221
etcdMemberVal = `etcd-member/${etcdMemberVal} `
222222
}
223223

224-
let reason = item.tempStructuredMessage.reason
224+
let reason = item.message.reason
225225
let color = 'EtcdOther'
226226
if (reason.length > 0) {
227227
color = reason
@@ -231,52 +231,52 @@ <h5 class="modal-title">Resource</h5>
231231
}
232232

233233
function cloudMetricsValue(item) {
234-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "CloudMetric"];
234+
return [buildLocatorDisplayString(item.locator), "", "CloudMetric"];
235235
}
236236

237237
function alertSeverity(item) {
238238
// the other types can be pending, so check pending first
239-
if (item.tempStructuredMessage.annotations["alertstate"] === "pending") {
240-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertPending"]
239+
if (item.message.annotations["alertstate"] === "pending") {
240+
return [buildLocatorDisplayString(item.locator), "", "AlertPending"]
241241
}
242242

243-
if (item.tempStructuredMessage.annotations["severity"] === "info") {
244-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertInfo"]
243+
if (item.message.annotations["severity"] === "info") {
244+
return [buildLocatorDisplayString(item.locator), "", "AlertInfo"]
245245
}
246-
if (item.tempStructuredMessage.annotations["severity"] === "warning") {
247-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertWarning"]
246+
if (item.message.annotations["severity"] === "warning") {
247+
return [buildLocatorDisplayString(item.locator), "", "AlertWarning"]
248248
}
249-
if (item.tempStructuredMessage.annotations["severity"] === "critical") {
250-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertCritical"]
249+
if (item.message.annotations["severity"] === "critical") {
250+
return [buildLocatorDisplayString(item.locator), "", "AlertCritical"]
251251
}
252252

253253
// color as critical if nothing matches so that we notice that something has gone wrong
254-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertCritical"]
254+
return [buildLocatorDisplayString(item.locator), "", "AlertCritical"]
255255
}
256256

257257
function apiserverDisruptionValue(item) {
258258
// TODO: isolate DNS error into CIClusterDisruption
259-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "Disruption"]
259+
return [buildLocatorDisplayString(item.locator), "", "Disruption"]
260260
}
261261

262262
function apiserverShutdownValue(item) {
263263
// TODO: isolate DNS error into CIClusterDisruption
264-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "GracefulShutdownInterval"]
264+
return [buildLocatorDisplayString(item.locator), "", "GracefulShutdownInterval"]
265265
}
266266

267267
function disruptionValue(item) {
268268
// We classify these disruption samples with this message if it thinks
269269
// it looks like a problem in the CI cluster running the tests, not the cluster under test.
270270
// (typically DNS lookup problems)
271-
if (item.tempStructuredMessage.reason === "DisruptionSamplerOutageBegan") {
272-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "CIClusterDisruption"]
271+
if (item.message.reason === "DisruptionSamplerOutageBegan") {
272+
return [buildLocatorDisplayString(item.locator), "", "CIClusterDisruption"]
273273
}
274-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "Disruption"]
274+
return [buildLocatorDisplayString(item.locator), "", "Disruption"]
275275
}
276276

277277
function apiserverShutdownEventsValue(item) {
278278
// TODO: isolate DNS error into CIClusterDisruption
279-
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "GracefulShutdownWindow"]
279+
return [buildLocatorDisplayString(item.locator), "", "GracefulShutdownWindow"]
280280
}
281281

282282
function getDurationString(durationSeconds) {
@@ -291,11 +291,11 @@ <h5 class="modal-title">Resource</h5>
291291
}
292292

293293
function defaultToolTip(item) {
294-
if (!item.tempStructuredMessage || !item.tempStructuredMessage.annotations) {
294+
if (!item.message || !item.message.annotations) {
295295
return '';
296296
}
297297

298-
const structuredMessage = item.tempStructuredMessage;
298+
const structuredMessage = item.message;
299299
const annotations = structuredMessage.annotations;
300300

301301
const keyValuePairs = Object.entries(annotations).map(([key, value]) => {
@@ -308,8 +308,8 @@ <h5 class="modal-title">Resource</h5>
308308
if ('display' in item) {
309309
tt = "display/" + item.display + " " + tt
310310
}
311-
if ('tempSource' in item) {
312-
tt = "source/" + item.tempSource + " " + tt
311+
if ('source' in item) {
312+
tt = "source/" + item.source + " " + tt
313313
}
314314
tt = tt + " " + getDurationString(((new Date(item.to)).getTime() - (new Date(item.from).getTime()))/1000);
315315
return tt
@@ -401,7 +401,7 @@ <h5 class="modal-title">Resource</h5>
401401
if (!item.to) {
402402
endDate = latest
403403
}
404-
let label = buildLocatorDisplayString(item.tempStructuredLocator)
404+
let label = buildLocatorDisplayString(item.locator)
405405
let sub = ""
406406
let val = timelineVal
407407
if (typeof val === "function") {
@@ -442,7 +442,7 @@ <h5 class="modal-title">Resource</h5>
442442
if (isEtcdLeadership(item)) {
443443

444444
// Don't chart the ones where the node is empty.
445-
const node = item.tempStructuredLocator.keys['node'] || ''
445+
const node = item.locator.keys['node'] || ''
446446
if (node.length > 0) {
447447
return true
448448
}

0 commit comments

Comments
 (0)