-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor [Navigator] Logger #27
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [+] feat(init_const.go): add constant for unsupported log level message
- [+] feat(navigator): add rate limiter for log output - [+] fix(navigator): change log level for error messages to info level
Perfect Structured logging $ go run debug.go
2023-12-24T01:02:58.903+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:02:58.903+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:02:58.904+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 1/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 1, "max_retries": 3, "task_name": "c check pods running 1"}
2023-12-24T01:02:58.904+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 1/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 1", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:00.905+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:03:00.905+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:03:00.905+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 2/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 2, "max_retries": 3, "task_name": "c check pods running 1"}
2023-12-24T01:03:00.905+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 2/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 1", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:02.915+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:03:02.915+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 1"}
2023-12-24T01:03:02.915+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 3/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 3, "max_retries": 3, "task_name": "c check pods running 1"}
2023-12-24T01:03:02.915+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 3/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 1", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:04.917+0700 INFO navigator/logger.go:38 ❌ Failed to complete task check pods running 1 after 3 attempts {"ships_namespace": "default", "task_name": "check pods running 1", "error": "Failed to complete task check pods running 1 after 3 attempts"}
2023-12-24T01:03:04.917+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:04.917+0700 INFO K8sBlackPearl/debug.go:104 Received result: Failed to complete task check pods running 1 after 3 attempts
2023-12-24T01:03:04.917+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:04.917+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 1/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 1, "max_retries": 3, "task_name": "c check pods running 2"}
2023-12-24T01:03:04.917+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 1/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 2", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:06.921+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:06.921+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:06.921+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 2/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 2, "max_retries": 3, "task_name": "c check pods running 2"}
2023-12-24T01:03:06.921+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 2/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 2", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:08.927+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:08.927+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 2"}
2023-12-24T01:03:08.927+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 3/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 3, "max_retries": 3, "task_name": "c check pods running 2"}
2023-12-24T01:03:08.927+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 3/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 2", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:10.935+0700 INFO navigator/logger.go:38 ❌ Failed to complete task check pods running 2 after 3 attempts {"ships_namespace": "default", "task_name": "check pods running 2", "error": "Failed to complete task check pods running 2 after 3 attempts"}
2023-12-24T01:03:10.935+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:10.936+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:10.935+0700 INFO K8sBlackPearl/debug.go:104 Received result: Failed to complete task check pods running 2 after 3 attempts
2023-12-24T01:03:10.936+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 1/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 1, "max_retries": 3, "task_name": "c check pods running 3"}
2023-12-24T01:03:10.936+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 1/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 3", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:12.941+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:12.941+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:12.941+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 2/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 2, "max_retries": 3, "task_name": "c check pods running 3"}
2023-12-24T01:03:12.941+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 2/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 3", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:14.945+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:14.945+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 3"}
2023-12-24T01:03:14.945+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 3/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 3, "max_retries": 3, "task_name": "c check pods running 3"}
2023-12-24T01:03:14.945+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 3/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 3", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:16.949+0700 INFO navigator/logger.go:38 ❌ Failed to complete task check pods running 3 after 3 attempts {"ships_namespace": "default", "task_name": "check pods running 3", "error": "Failed to complete task check pods running 3 after 3 attempts"}
2023-12-24T01:03:16.949+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:16.949+0700 INFO K8sBlackPearl/debug.go:104 Received result: Failed to complete task check pods running 3 after 3 attempts
2023-12-24T01:03:16.949+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:16.950+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 1/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 1, "max_retries": 3, "task_name": "c check pods running 4"}
2023-12-24T01:03:16.950+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 1/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 4", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:18.954+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:18.954+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:18.954+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 2/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 2, "max_retries": 3, "task_name": "c check pods running 4"}
2023-12-24T01:03:18.955+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 2/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 4", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:20.963+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:20.963+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 4"}
2023-12-24T01:03:20.963+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 3/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 3, "max_retries": 3, "task_name": "c check pods running 4"}
2023-12-24T01:03:20.964+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 3/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 4", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:22.974+0700 INFO navigator/logger.go:38 ❌ Failed to complete task check pods running 4 after 3 attempts {"ships_namespace": "default", "task_name": "check pods running 4", "error": "Failed to complete task check pods running 4 after 3 attempts"}
2023-12-24T01:03:22.974+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:22.974+0700 INFO K8sBlackPearl/debug.go:104 Received result: Failed to complete task check pods running 4 after 3 attempts
2023-12-24T01:03:22.975+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:22.975+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 1/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 1, "max_retries": 3, "task_name": "c check pods running 5"}
2023-12-24T01:03:24.983+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:24.983+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:24.983+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 2/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 2, "max_retries": 3, "task_name": "c check pods running 5"}
2023-12-24T01:03:24.984+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 2/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 5", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:26.997+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Fetching pods {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:26.997+0700 INFO navigator/logger.go:38 🏴☠️ invalid parameters {"sailing": "FetchPods", "shipsnamespace": "default", "task_name": "check pods running 5"}
2023-12-24T01:03:26.997+0700 INFO navigator/logger.go:38 🏴☠️ Crew Worker 0: Retrying task 3/3 {"sailing": "FetchPods", "shipsnamespace": "default", "crew_worker": 0, "attempt": 3, "max_retries": 3, "task_name": "c check pods running 5"}
2023-12-24T01:03:26.997+0700 INFO navigator/logger.go:38 ❌ Error during task, attempt 3/3: invalid parameters: labelSelector, fieldSelector, or limit {"task_name": "check pods running 5", "error": "invalid parameters: labelSelector, fieldSelector, or limit"}
2023-12-24T01:03:29.008+0700 INFO navigator/logger.go:38 ❌ Failed to complete task check pods running 5 after 3 attempts {"ships_namespace": "default", "task_name": "check pods running 5", "error": "Failed to complete task check pods running 5 after 3 attempts"}
2023-12-24T01:03:29.009+0700 INFO K8sBlackPearl/debug.go:104 Received result: Failed to complete task check pods running 5 after 3 attempts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.