Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Switch zap log for global hub manager #1185

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

yanmxa
Copy link
Member

@yanmxa yanmxa commented Oct 25, 2024

Summary

Related issue(s)

Fixes # https://issues.redhat.com/browse/ACM-13421, #1178

Tests

  • Unit/function tests have been added and incorporated into make unit-tests.
  • Integration tests have been added and incorporated into make integration-test.
  • E2E tests have been added and incorporated into make e2e-test-all.
  • List other manual tests you have done.
2024-10-30T01:20:44.725Z        INFO    utils/utils.go:28       Go OS/Arch: linux/amd64
2024-10-30T01:20:44.725Z        INFO    utils/utils.go:29       Go Version: go1.22.5
2024-10-30T01:20:44.725Z        INFO    utils/utils.go:30       Git Commit: 0e0ccfa9
2024-10-30T01:20:44.744Z        INFO    cronjob/scheduler.go:68 set SyncLocalCompliance job     {"scheduleAt": "00:00"}
2024-10-30T01:20:44.744Z        INFO    cronjob/scheduler.go:77 set DataRetention jobscheduleAt00:00
2024-10-30T01:20:44.744Z        INFO    controller-runtime.metrics      server/server.go:208    Starting metrics server
I1030 01:20:44.744263       1 leaderelection.go:254] attempting to acquire leader lease multicluster-global-hub/multicluster-global-hub-manager-lock...
2024-10-30T01:20:44.744Z        INFO    controller-runtime.metrics      server/server.go:247    Serving metrics server  {"bindAddress": "0.0.0.0:8384", "secure": false}
I1030 01:23:06.543481       1 leaderelection.go:268] successfully acquired lease multicluster-global-hub/multicluster-global-hub-manager-lock
2024-10-30T01:23:06.543Z        INFO    cronjob/scheduler.go:86 start job scheduler
"ConfigMap", "worker count": 1}
2024-10-30T01:23:06.745Z        INFO    controller/controller.go:217    Starting workers        {"controller": "secret", "controllerGroup": "", "controllerKind": "Secret", "worker count": 1}
2024-10-30T01:23:06.745Z        INFO    controller/controller.go:217    Starting workers        {"controller": "backupPvcController", "controllerGroup": "", "controllerKind": "PersistentVolumeClaim", "worker count": 1}
2024-10-30T01:23:06.745Z        INFO    kafka-consumer  consumer/generic_consumer.go:84 transport consumer with cloudevents-kafka receiver
2024-10-30T01:23:06.750Z        INFO    dispatcher/transport_dispatcher.go:42   transport dispatcher starts dispatching received events...
2024-10-30T01:23:06.750Z        INFO    statistics      statistics/statistics.go:97     starting statistics
2024-10-30T01:23:06.750Z        INFO    dispatcher/conflation_dispatcher.go:64  starting dispatcher
2024-10-30T01:23:06.750Z        INFO    worker-pool     workerpool/worker_pool.go:38    connection stats        {"open connection(worker)": 1, "max": 10}
2024-10-30T01:23:06.750Z        INFO    worker-pool     workerpool/worker.go:46 started worker  {"WorkerID": 10}
...
2024-10-30T01:23:06.750Z        INFO    worker-pool     workerpool/worker.go:46 started worker  {"WorkerID": 5}
2024-10-30T01:23:06.750Z        INFO    worker-pool     workerpool/worker.go:46 started worker  {"WorkerID": 7}
2024-10-30T01:23:06.750Z        INFO    hub-management  hubmanagement/hub_management.go:73      hub management status switch frequency  {"interval": "2m0s"}
2024-10-30T01:23:06.750Z        INFO    controller/controller.go:175    Starting EventSource    {"controller": "migration-controller", "controllerGroup": "global-hub.open-cluster-management.io", "controllerKind": "ManagedClusterMigration", "source": "kind source: *v1alpha1.ManagedClusterMigration"}
2024-10-30T01:23:06.750Z        INFO    controller/controller.go:175    Starting EventSource    {"controller": "migration-controller", "controllerGroup": "global-hub.open-cluster-management.io", "controllerKind": "ManagedClusterMigration", "source": "kind source: *v1beta1.ManagedServiceAccount"}
2024-10-30T01:23:06.750Z        INFO    controller/controller.go:183    Starting Controller     {"controller": "migration-controller", "controllerGroup": "global-hub.open-cluster-management.io", "controllerKind": "ManagedClusterMigration"}
2024-10-30T01:23:06.754Z        INFO    kafka-consumer  consumer/generic_consumer.go:150        init consumeroffsets[]
2024-10-30T01:23:06.754Z        INFO    cloudevents     [email protected]/protocol.go:166   Subscribing to topics: [^gh-status.*]
2024-10-30T01:23:06.853Z        INFO    controller/controller.go:217    Starting workers        {"controller": "migration-controller", "controllerGroup": "global-hub.open-cluster-management.io", "controllerKind": "ManagedClusterMigration", "worker count": 1}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.policy.localspec    conflator/element_complete.go:66        resetting element processed version     {"version": "0.1"}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.managedhub.heartbeat        conflator/element_complete.go:66        resetting element processed version     {"version": "0.0"}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.policy.localcompletecompliance      conflator/element_complete.go:66        resetting element processed version     {"version": "0.1"}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.policy.localcompliance      conflator/element_complete.go:66        resetting element processed version     {"version": "0.1"}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.managedcluster      conflator/element_complete.go:66        resetting element processed version     {"version": "0.1"}
2024-10-30T01:23:10.007Z        INFO    demo-hub-a.complete.managedhub.info     conflator/element_complete.go:66        resetting element processed version     {"version": "0.2"}

@yanmxa yanmxa changed the title ✨ ✨ Switch zap log for global hub agent ✨ Switch zap log for global hub agent Oct 25, 2024
@yanmxa yanmxa changed the title ✨ Switch zap log for global hub agent ✨ Switch zap log for global hub manager Oct 25, 2024
@yanmxa yanmxa force-pushed the br_manager branch 2 times, most recently from 8baea1a to 02c0c1b Compare October 29, 2024 07:03
Signed-off-by: myan <[email protected]>

fix the error

Signed-off-by: myan <[email protected]>

fix the info

Signed-off-by: myan <[email protected]>

adjust agent log

Signed-off-by: myan <[email protected]>

change the transport

Signed-off-by: myan <[email protected]>

fix the standalone

Signed-off-by: myan <[email protected]>

add the e2e log

Signed-off-by: myan <[email protected]>

add the controller runtime log with current zap logger

Signed-off-by: myan <[email protected]>

format code

Signed-off-by: myan <[email protected]>

romove the zap parameter from standalone agent

Signed-off-by: myan <[email protected]>

remove the  unnecessary code

Signed-off-by: myan <[email protected]>

remove the log print

Signed-off-by: myan <[email protected]>

add manager zap log

Signed-off-by: myan <[email protected]>

add manager configmap controller

Signed-off-by: myan <[email protected]>

log remove klog

Signed-off-by: myan <[email protected]>

remove the go flag

Signed-off-by: myan <[email protected]>

fix the log

Signed-off-by: myan <[email protected]>
@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

e2e setup error
/test test-e2e

@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

/override ci/prow/sonarcloud

Copy link

openshift-ci bot commented Oct 30, 2024

@yanmxa: Overrode contexts on behalf of yanmxa: ci/prow/sonarcloud

In response to this:

/override ci/prow/sonarcloud

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

/test test-e2e

@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

/override "SonarCloud Code Analysis"

Copy link

openshift-ci bot commented Oct 30, 2024

@yanmxa: Overrode contexts on behalf of yanmxa: SonarCloud Code Analysis

In response to this:

/override "SonarCloud Code Analysis"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Signed-off-by: myan <[email protected]>
}

if managerConfig.EnablePprof {
go utils.StartDefaultPprofServer()
}

utils.PrintVersion(setupLog)
utils.RuntimeInfo()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe PrintRuntimeInfo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -3,6 +3,9 @@ kind: Secret
metadata:
name: {{.TransportConfigSecret}}
namespace: {{.Namespace}}
annotations:
# todo put here or configmap
za-log-level: {{.LogLevel}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't add in here, remove it now.

Signed-off-by: myan <[email protected]>
@clyang82
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 30, 2024
Copy link

openshift-ci bot commented Oct 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clyang82, yanmxa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

sonarcloud bot commented Oct 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
63.7% Coverage on New Code (required ≥ 70%)

See analysis details on SonarCloud

@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

/override ci/prow/sonarcloud

Copy link

openshift-ci bot commented Oct 30, 2024

@yanmxa: Overrode contexts on behalf of yanmxa: ci/prow/sonarcloud

In response to this:

/override ci/prow/sonarcloud

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yanmxa
Copy link
Member Author

yanmxa commented Oct 30, 2024

/override "SonarCloud Code Analysis"

Copy link

openshift-ci bot commented Oct 30, 2024

@yanmxa: Overrode contexts on behalf of yanmxa: SonarCloud Code Analysis

In response to this:

/override "SonarCloud Code Analysis"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 87cf169 into stolostron:main Oct 30, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants