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

fix(sendconfig) suppress deck diff logs at info #2422

Merged
merged 1 commit into from
Apr 19, 2022
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Apr 19, 2022

What this PR does / why we need it:
Disable deck's full diff output at log level info and above. diffs will only print at debug or trace.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #2411

Special notes for your reviewer:
deck doesn't run this output through the regular logging pipeline, so it has no log level, and is controlled independently by the --silence-events flag.

I opted to limit it to debug and lower since AFAIK it doesn't have any type-specific logic for anything other than Konnect Documents, so it prints changes to certificates and credentials and such, which we don't want at info.

Ideally deck would return diff text to a callers to allow them to determine how to print it (so we could pass it through our logger while the deck CLI does what it does currently), but as it's a direct call to console print from the diff loop, we can only suppress these logs, not add proper level/timestamp/fields formatting (multi-line output makes that a pain even if we could).

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@rainest rainest requested a review from a team as a code owner April 19, 2022 20:49
@rainest rainest temporarily deployed to Configure ci April 19, 2022 20:49 Inactive
@rainest rainest temporarily deployed to Configure ci April 19, 2022 20:49 Inactive
@rainest
Copy link
Contributor Author

rainest commented Apr 19, 2022

For comparison from a manual run:

time="2022-04-19T20:38:59Z" level=debug msg="sending configuration to Kong Admin API"
updating route default.httpbin.00  {
   "https_redirect_status_code": 426,
   "id": "d63e3f12-ab1a-4cb2-81be-6a1b69a86111",
   "name": "default.httpbin.00",
   "path_handling": "v0",
   "paths": [
-    "/httpbina"
+    "/httpbinb"
   ],
   "preserve_host": true,
   "protocols": [
     "http",
     "https"
   ],
   "regex_priority": 100,
   "request_buffering": true,
   "response_buffering": true,
   "service": {
     "id": "a043ce1c-c107-4647-8cbf-ea9db51db307"
   },
   "strip_path": false,
   "tags": [
     "managed-by-ingress-controller"
   ]
 }

time="2022-04-19T20:38:59Z" level=info msg="successfully synced configuration to kong."
time="2022-04-19T20:40:16Z" level=info msg="successfully synced configuration to kong."
time="2022-04-19T20:40:19Z" level=error msg="failed to fetch KongPlugin: no KongPlugin or KongClusterPlugin was found" kongplugin_name=kong-id kongplugin_namespace=default
time="2022-04-19T20:40:22Z" level=error msg="failed to fetch KongPlugin: no KongPlugin or KongClusterPlugin was found" kongplugin_name=kong-id kongplugin_namespace=default
time="2022-04-19T20:40:22Z" level=info msg="successfully synced configuration to kong."
time="2022-04-19T20:40:25Z" level=error msg="failed to fetch KongPlugin: no KongPlugin or KongClusterPlugin was found" kongplugin_name=kong-id kongplugin_namespace=default

Disable deck's full diff output at log level info and above. diffs will
only print at debug or trace.
@rainest rainest temporarily deployed to Configure ci April 19, 2022 20:51 Inactive
@rainest rainest temporarily deployed to Configure ci April 19, 2022 20:51 Inactive
@rainest rainest enabled auto-merge (rebase) April 19, 2022 20:51
@rainest rainest temporarily deployed to Configure ci April 19, 2022 21:15 Inactive
@rainest rainest merged commit 6dff89e into main Apr 19, 2022
@rainest rainest deleted the fix/suppress-deck branch April 19, 2022 21:34
@aroundthecode
Copy link

Hi guys, thanks for the fix! Any estimated release date? I've my server under heavy log flow and I'd like to fix it asap.

@rainest
Copy link
Contributor Author

rainest commented Apr 22, 2022

We don't have a set release schedule, but do make pre-release builds available at https://hub.docker.com/r/kong/nightly-ingress-controller/tags?page=1&ordering=last_updated

You can use one of the recent specific date tags to get that change but not new changes we add after. There's not much else new in yet since 2.3.1 outside some Gateway API-related changes.

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.

Logging service configuration outside managed loglevels
3 participants