Skip to content

Commit

Permalink
Merge pull request #28727 from dgoodwin/drop-interval-loc-msg
Browse files Browse the repository at this point in the history
TRT-1610: Intervals, move over to new schema, finally...
  • Loading branch information
openshift-merge-bot[bot] committed Apr 30, 2024
2 parents efa2ab6 + d87fae9 commit 221cc88
Show file tree
Hide file tree
Showing 84 changed files with 2,793 additions and 3,992 deletions.
132 changes: 66 additions & 66 deletions e2echart/e2e-chart-template.html
Expand Up @@ -77,151 +77,151 @@ <h5 class="modal-title">Resource</h5>
});

function isOperatorAvailable(eventInterval) {
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
eventInterval.tempStructuredMessage.annotations["condition"] === "Available" &&
eventInterval.tempStructuredMessage.annotations["status"] === "False";
return eventInterval.locator.type === "ClusterOperator" &&
eventInterval.message.annotations["condition"] === "Available" &&
eventInterval.message.annotations["status"] === "False";
}

function isOperatorDegraded(eventInterval) {
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
eventInterval.tempStructuredMessage.annotations["condition"] === "Degraded" &&
eventInterval.tempStructuredMessage.annotations["status"] === "True";
return eventInterval.locator.type === "ClusterOperator" &&
eventInterval.message.annotations["condition"] === "Degraded" &&
eventInterval.message.annotations["status"] === "True";
}

function isOperatorProgressing(eventInterval) {
return eventInterval.tempStructuredLocator.type === "ClusterOperator" &&
eventInterval.tempStructuredMessage.annotations["condition"] === "Progressing" &&
eventInterval.tempStructuredMessage.annotations["status"] === "True";
return eventInterval.locator.type === "ClusterOperator" &&
eventInterval.message.annotations["condition"] === "Progressing" &&
eventInterval.message.annotations["status"] === "True";
}

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

}

function isPodLog(eventInterval) {
if (eventInterval.tempSource === 'PodLog') {
if (eventInterval.source === 'PodLog') {
return true
}
return eventInterval.tempSource === 'EtcdLog';
return eventInterval.source === 'EtcdLog';

}

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

function isE2EFailed(eventInterval) {
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Failed") {
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Failed") {
return true
}
return false
}

function isE2EFlaked(eventInterval) {
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Flaked") {
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Flaked") {
return true
}
return false
}

function isE2EPassed(eventInterval) {
if (eventInterval.tempSource === "E2ETest" && eventInterval.tempStructuredMessage.annotations["status"] === "Passed") {
if (eventInterval.source === "E2ETest" && eventInterval.message.annotations["status"] === "Passed") {
return true
}
return false
}

function isGracefulShutdownActivity(eventInterval) {
return (eventInterval.tempSource === "APIServerGracefulShutdown")
return (eventInterval.source === "APIServerGracefulShutdown")
}

function isEndpointConnectivity(eventInterval) {
if (eventInterval.tempStructuredMessage.reason !== "DisruptionBegan" && eventInterval.tempStructuredMessage.reason !== "DisruptionSamplerOutageBegan") {
if (eventInterval.message.reason !== "DisruptionBegan" && eventInterval.message.reason !== "DisruptionSamplerOutageBegan") {
return false
}
if (eventInterval.tempSource === "Disruption") {
if (eventInterval.source === "Disruption") {
return true
}
if (eventInterval.tempStructuredLocator.keys["namespace"] === "e2e-k8s-service-lb-available") {
if (eventInterval.locator.keys["namespace"] === "e2e-k8s-service-lb-available") {
return true
}
if (eventInterval.tempStructuredLocator.keys.has("route")) {
if (eventInterval.locator.keys.has("route")) {
return true
}

return false
}

function isNodeState(eventInterval) {
return eventInterval.tempSource === "NodeState"
return eventInterval.source === "NodeState"
}

function isCloudMetrics(eventInterval) {
return eventInterval.tempSource === "CloudMetrics";
return eventInterval.source === "CloudMetrics";
}

function isAlert(eventInterval) {
return eventInterval.tempSource === "Alert"
return eventInterval.source === "Alert"
}

function pathologicalEvents(item) {
if (item.tempStructuredMessage.annotations["pathological"] === "true") {
if (item.tempStructuredMessage.annotations["interesting"] === "true") {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pathological known)`, "PathologicalKnown"];
if (item.message.annotations["pathological"] === "true") {
if (item.message.annotations["interesting"] === "true") {
return [buildLocatorDisplayString(item.locator), ` (pathological known)`, "PathologicalKnown"];
} else {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pathological new)`, "PathologicalNew"];
return [buildLocatorDisplayString(item.locator), ` (pathological new)`, "PathologicalNew"];
}
}
// TODO: hack that can likely be removed when we get to structured intervals for these
// Always show pod sandbox events even if they didn't make it to pathological
if (item.tempStructuredMessage.annotations["interesting"] === "true" && item.tempStructuredMessage.humanMessage.includes("pod sandbox")) {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod sandbox)`, "PodSandbox"];
if (item.message.annotations["interesting"] === "true" && item.message.humanMessage.includes("pod sandbox")) {
return [buildLocatorDisplayString(item.locator), ` (pod sandbox)`, "PodSandbox"];
}
}

function podLogs(item) {
if (item.level == "Warning") {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogWarning"];
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogWarning"];
}
if (item.level == "Error") {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogError"];
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogError"];
}
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (pod log)`, "PodLogInfo"];
return [buildLocatorDisplayString(item.locator), ` (pod log)`, "PodLogInfo"];
}


const rePhase = new RegExp("(^| )phase/([^ ]+)")
function nodeStateValue(item) {
let roles = ""
if (item.tempStructuredMessage.annotations.hasOwnProperty('roles')) {
roles = item.tempStructuredMessage.annotations.roles
if (item.message.annotations.hasOwnProperty('roles')) {
roles = item.message.annotations.roles
}

if (item.tempStructuredMessage.reason === 'NotReady') {
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (${roles})`, "NodeNotReady"]
if (item.message.reason === 'NotReady') {
return [buildLocatorDisplayString(item.locator), ` (${roles})`, "NodeNotReady"]
}
let m = item.tempStructuredMessage.annotations.phase;
return [buildLocatorDisplayString(item.tempStructuredLocator), ` (${roles})`, m];
let m = item.message.annotations.phase;
return [buildLocatorDisplayString(item.locator), ` (${roles})`, m];
}

function etcdLeadershipLogsValue(item) {

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

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

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

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

function cloudMetricsValue(item) {
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "CloudMetric"];
return [buildLocatorDisplayString(item.locator), "", "CloudMetric"];
}

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

if (item.tempStructuredMessage.annotations["severity"] === "info") {
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertInfo"]
if (item.message.annotations["severity"] === "info") {
return [buildLocatorDisplayString(item.locator), "", "AlertInfo"]
}
if (item.tempStructuredMessage.annotations["severity"] === "warning") {
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertWarning"]
if (item.message.annotations["severity"] === "warning") {
return [buildLocatorDisplayString(item.locator), "", "AlertWarning"]
}
if (item.tempStructuredMessage.annotations["severity"] === "critical") {
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "AlertCritical"]
if (item.message.annotations["severity"] === "critical") {
return [buildLocatorDisplayString(item.locator), "", "AlertCritical"]
}

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

function apiserverDisruptionValue(item) {
// TODO: isolate DNS error into CIClusterDisruption
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "Disruption"]
return [buildLocatorDisplayString(item.locator), "", "Disruption"]
}

function apiserverShutdownValue(item) {
// TODO: isolate DNS error into CIClusterDisruption
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "GracefulShutdownInterval"]
return [buildLocatorDisplayString(item.locator), "", "GracefulShutdownInterval"]
}

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

function apiserverShutdownEventsValue(item) {
// TODO: isolate DNS error into CIClusterDisruption
return [buildLocatorDisplayString(item.tempStructuredLocator), "", "GracefulShutdownWindow"]
return [buildLocatorDisplayString(item.locator), "", "GracefulShutdownWindow"]
}

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

function defaultToolTip(item) {
if (!item.tempStructuredMessage || !item.tempStructuredMessage.annotations) {
if (!item.message || !item.message.annotations) {
return '';
}

const structuredMessage = item.tempStructuredMessage;
const structuredMessage = item.message;
const annotations = structuredMessage.annotations;

const keyValuePairs = Object.entries(annotations).map(([key, value]) => {
Expand All @@ -308,8 +308,8 @@ <h5 class="modal-title">Resource</h5>
if ('display' in item) {
tt = "display/" + item.display + " " + tt
}
if ('tempSource' in item) {
tt = "source/" + item.tempSource + " " + tt
if ('source' in item) {
tt = "source/" + item.source + " " + tt
}
tt = tt + " " + getDurationString(((new Date(item.to)).getTime() - (new Date(item.from).getTime()))/1000);
return tt
Expand Down Expand Up @@ -401,7 +401,7 @@ <h5 class="modal-title">Resource</h5>
if (!item.to) {
endDate = latest
}
let label = buildLocatorDisplayString(item.tempStructuredLocator)
let label = buildLocatorDisplayString(item.locator)
let sub = ""
let val = timelineVal
if (typeof val === "function") {
Expand Down Expand Up @@ -442,7 +442,7 @@ <h5 class="modal-title">Resource</h5>
if (isEtcdLeadership(item)) {

// Don't chart the ones where the node is empty.
const node = item.tempStructuredLocator.keys['node'] || ''
const node = item.locator.keys['node'] || ''
if (node.length > 0) {
return true
}
Expand Down

0 comments on commit 221cc88

Please sign in to comment.