Skip to content

Commit

Permalink
operator log scraper: ensure that events have different from/to time …
Browse files Browse the repository at this point in the history
…so that spyglass would render them
  • Loading branch information
vrutkovs committed Jan 29, 2025
1 parent c9ee7a3 commit fe5b18b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
Reason(monitorapi.LeaseAcquiringStarted).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
Build(logLine.Instant, logLine.Instant.Add(time.Second)),
)
case strings.Contains(logLine.Line, "successfully acquired lease") &&
!strings.Contains(logLine.Line, "Degraded"): // need to exclude lines that re-embed the kube-controller-manager log
Expand All @@ -184,7 +184,7 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
Reason(monitorapi.LeaseAcquired).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
Build(logLine.Instant, logLine.Instant.Add(time.Second)),
)
case strings.Contains(logLine.Line, "unable to ApplyStatus for operator") &&
strings.Contains(logLine.Line, "is invalid"): // apply failures
Expand All @@ -195,7 +195,7 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
Reason(monitorapi.ReasonBadOperatorApply).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
Build(logLine.Instant, logLine.Instant.Add(time.Second)),
)
case strings.Contains(logLine.Line, "unable to Apply for operator") &&
strings.Contains(logLine.Line, "is invalid"): // apply failures
Expand All @@ -206,7 +206,7 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
Reason(monitorapi.ReasonBadOperatorApply).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
Build(logLine.Instant, logLine.Instant.Add(time.Second)),
)
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(
Expand All @@ -216,7 +216,7 @@ func (g operatorLogHandler) HandleLogLine(logLine podaccess.LogLineContent) {
Reason(monitorapi.ReasonEtcdBootstrap).
HumanMessage(logLine.Line),
).
Build(logLine.Instant, logLine.Instant),
Build(logLine.Instant, logLine.Instant.Add(time.Second)),
)
}

Expand Down

0 comments on commit fe5b18b

Please sign in to comment.