Skip to content

Commit

Permalink
health checks logs are not ingested to Cloud Logging - debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
XuechunHou committed Jan 31, 2025
1 parent 2d29934 commit 182972e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration_test/ops_agent_test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3814,6 +3814,7 @@ func TestLoggingSelfLogs(t *testing.T) {
}

queryHealthCheck := fmt.Sprintf(`severity="INFO" AND labels."agent.googleapis.com/health/agentKind"="ops-agent" AND labels."agent.googleapis.com/health/agentVersion"=~"^\d+\.\d+\.\d+.*$" AND labels."agent.googleapis.com/health/schemaVersion"="v1"`)
queryHealthCheck = ""
if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "ops-agent-health", time.Hour, queryHealthCheck); err != nil {
t.Error(err)
}
Expand All @@ -3822,6 +3823,7 @@ func TestLoggingSelfLogs(t *testing.T) {
// "LogPingOpsAgent" to show. We can remove wait when feature b/319102785 is complete.
time.Sleep(10*time.Minute - time.Now().Sub(start))
queryPing := fmt.Sprintf(`severity="DEBUG" AND jsonPayload.code="LogPingOpsAgent" AND labels."agent.googleapis.com/health/agentKind"="ops-agent" AND labels."agent.googleapis.com/health/agentVersion"=~"^\d+\.\d+\.\d+.*$" AND labels."agent.googleapis.com/health/schemaVersion"="v1"`)
queryPing = ""
if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "ops-agent-health", time.Hour, queryPing); err != nil {
t.Error(err)
}
Expand Down

0 comments on commit 182972e

Please sign in to comment.