Skip to content

Commit

Permalink
add bootstrap removed event from CEO
Browse files Browse the repository at this point in the history
  • Loading branch information
vrutkovs committed Jan 28, 2025
1 parent c0e422d commit 8bcb2e0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions e2echart/e2e-chart-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ <h5 class="modal-title">Resource</h5>

}

function isEtcdBootstrap(eventInterval) {
return eventInterval.source === 'PodLog' && eventInterval.message.reason === "EtcdBootstrap";

}

function isPodLog(eventInterval) {
if (eventInterval.source === 'PodLog') {
return true
Expand Down Expand Up @@ -500,6 +505,7 @@ <h5 class="modal-title">Resource</h5>

timelineGroups.push({ group: "etcd-leaders", data: [] })
createTimelineData(etcdLeadershipLogsValue, timelineGroups[timelineGroups.length - 1].data, eventIntervals, isEtcdLeadershipAndNotEmpty, regex)
createTimelineData("Bootstrap", timelineGroups[timelineGroups.length - 1].data, eventIntervals, isEtcdBootstrap, regex)

timelineGroups.push({group: "cloud-metrics", data: []})
createTimelineData(cloudMetricsValue, timelineGroups[timelineGroups.length - 1].data, eventIntervals, isCloudMetrics, regex)
Expand Down
2 changes: 2 additions & 0 deletions pkg/monitor/monitorapi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ const (

ReasonHighGeneration IntervalReason = "HighGeneration"
ReasonInvalidGeneration IntervalReason = "GenerationViolation"

ReasonEtcdBootstrap IntervalReason = "EtcdBootstrap"
)

type AnnotationKey string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"context"
"errors"
"fmt"
"github.com/openshift/origin/pkg/monitortests/testframework/watchnamespaces"
"strings"
"time"

"github.com/openshift/origin/pkg/monitortests/testframework/watchnamespaces"

"github.com/openshift/origin/pkg/monitor"
"github.com/openshift/origin/pkg/monitor/monitorapi"
"github.com/openshift/origin/pkg/monitortestframework"
Expand Down Expand Up @@ -207,6 +208,16 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
).
Build(logLine.Instant, logLine.Instant),
)
case strings.Contains(logLine.Line, "Removing bootstrap member") || strings.Contains(logLine.Line, "Successfully removed bootstrap member") || strings.Contains(logLine.Line, "Cluster etcd operator bootstrapped successfully"): // ceo removed bootstrap member
g.recorder.AddIntervals(
monitorapi.NewInterval(monitorapi.SourcePodLog, monitorapi.Info).
Locator(logLine.Locator).
Message(monitorapi.NewMessage().
Reason(monitorapi.ReasonEtcdBootstrap).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
)
}

}
6 changes: 6 additions & 0 deletions test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8bcb2e0

Please sign in to comment.