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

Option to adjust SimpleQueue logging? #175

Open
KengTeong opened this issue Oct 15, 2021 · 5 comments
Open

Option to adjust SimpleQueue logging? #175

KengTeong opened this issue Oct 15, 2021 · 5 comments

Comments

@KengTeong
Copy link

KengTeong commented Oct 15, 2021

Greetings! I have a question on the chart for passing extra vars to limit the amount of noise generated from the SimpleQueue service.

Anchore Version Information:
Anchore Engine (preloaded-db) v0.10.1

Below is an example where I attempted to pass an extra variable for logging telling it to only post debug level logs.
(Note* it is now commented out since it did not work)

image

However, when I checked the logs in Argo it is still spamming the log. It appears as though the log is actually generated from the python requests module.

simplequeue noise

Questions:

  1. Is there a way I can minimize the amount of logging information from the SimpleQueue service? Either by an extra variable or other option?

  2. What Arguments can be passed to SimpleQueue

  3. Can we change the polling interval

  4. Is 0 or -1 off for values

@Btodhunter
Copy link
Member

@KengTeong Thanks for the input! Currently the chart does not have any mechanisms for adjusting the log level for individual services. The only option at the moment is Values.anchoreGlobal.logLevel which sets the log level for all services.

This would be a good addition to the chart though, so I'm leaving this issue open.

@frumpleswift
Copy link

I work with @KengTeong, and tested changing Values.anchoreGlobal.logLevel.

I set the logLevel to ERROR and redeployed anchore. However, the simple queue logs were not affected by the change.

image

[user@bastion ~]$ k logs -n anchore anchore-engine-anchore-engine-simplequeue-6d4f7464bd-lvvnv | tail -n 20 [service:simplequeue] 2021-10-22 22:11:01+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:01 +0000] "GET /v1/leases/analyzer_queue HTTP/1.1" 200 87 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:01+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:01 +0000] "GET /v1/leases/analyzer_queue/acquire?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708675897088%3A&ttl=60 HTTP/1.1" 200 182 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:01+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:01 +0000] "GET /v1/leases/analyzer_queue/release?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708675897088%3A&epoch=1745 HTTP/1.1" 200 - "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:03+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "POST /v1/queues/watcher_tasks/is_inqueue HTTP/1.1" 200 3 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:03+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "POST /v1/queues/watcher_tasks?qcount=0&forcefirst=False HTTP/1.1" 200 5 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:03+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "GET /v1/queues/watcher_tasks?wait_max_seconds=30&visibility_timeout=0 HTTP/1.1" 200 451 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:03+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "GET /v1/leases/analyzer_queue HTTP/1.1" 200 87 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:03+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "GET /v1/leases/analyzer_queue/acquire?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708692682496%3A&ttl=60 HTTP/1.1" 200 182 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:04+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:03 +0000] "GET /v1/leases/analyzer_queue/release?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708692682496%3A&epoch=1747 HTTP/1.1" 200 - "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks/is_inqueue HTTP/1.1" 200 3 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks?qcount=0&forcefirst=False HTTP/1.1" 200 5 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks/is_inqueue HTTP/1.1" 200 3 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks?qcount=0&forcefirst=False HTTP/1.1" 200 5 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks/is_inqueue HTTP/1.1" 200 3 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:05+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "POST /v1/queues/watcher_tasks?qcount=0&forcefirst=False HTTP/1.1" 200 5 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:06+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "GET /v1/queues/watcher_tasks?wait_max_seconds=30&visibility_timeout=0 HTTP/1.1" 200 451 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:06+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "GET /v1/leases/analyzer_queue HTTP/1.1" 200 87 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:06+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "GET /v1/queues/watcher_tasks?wait_max_seconds=30&visibility_timeout=0 HTTP/1.1" 200 449 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:06+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "GET /v1/leases/analyzer_queue/acquire?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708659111680%3A&ttl=60 HTTP/1.1" 200 182 "-" "python-requests/2.26.0" [service:simplequeue] 2021-10-22 22:11:06+0000 [-] "127.0.0.1" - - [22/Oct/2021:22:11:05 +0000] "GET /v1/leases/notifications HTTP/1.1" 200 85 "-" "python-requests/2.26.0" [user@bastion ~]$

@Btodhunter
Copy link
Member

@frumpleswift Thanks for the follow up. Can you do me a favor and shell into the simplequeue service and head /config/config.yaml an verify that the config has log_level: ERROR in it?

@frumpleswift
Copy link

frumpleswift commented Oct 23, 2021

Here is the config file:

[user@bastion ~]$ k exec -it -n anchore anchore-engine-anchore-engine-simplequeue-6d4f7464bd-lvvnv -- head /config/config.yaml
Defaulting container name to anchore-engine-simplequeue.
Use kubectl describe pod/anchore-engine-anchore-engine-simplequeue-6d4f7464bd-lvvnv -n anchore to see all of the containers in this pod.
# Anchore Service Configuration File from ConfigMap
service_dir: /anchore_service
tmp_dir: /analysis_scratch
log_level: ERROR
image_analyze_timeout_seconds: 36000
allow_awsecr_iam_auto: false
host_id: "${ANCHORE_POD_NAME}"
internal_ssl_verify: false
auto_restart_services: false
[user@bastion ~]$ 

and just to show logs once more:

[user@bastion ~]$ k logs -n anchore anchore-engine-anchore-engine-simplequeue-6d4f7464bd-lvvnv | tail -n 5
[service:simplequeue] 2021-10-23 01:25:21+0000 [-] "127.0.0.1" - - [23/Oct/2021:01:25:21 +0000] "POST /v1/queues/watcher_tasks/is_inqueue HTTP/1.1" 200 3 "-" "python-requests/2.26.0"
[service:simplequeue] 2021-10-23 01:25:21+0000 [-] "127.0.0.1" - - [23/Oct/2021:01:25:21 +0000] "POST /v1/queues/watcher_tasks?qcount=0&forcefirst=False HTTP/1.1" 200 5 "-" "python-requests/2.26.0"
[service:simplequeue] 2021-10-23 01:25:21+0000 [-] "127.0.0.1" - - [23/Oct/2021:01:25:21 +0000] "GET /v1/queues/watcher_tasks?wait_max_seconds=30&visibility_timeout=0 HTTP/1.1" 200 451 "-" "python-requests/2.26.0"
[service:simplequeue] 2021-10-23 01:25:21+0000 [-] "127.0.0.1" - - [23/Oct/2021:01:25:21 +0000] "GET /v1/leases/analyzer_queue HTTP/1.1" 200 88 "-" "python-requests/2.26.0"
[service:simplequeue] 2021-10-23 01:25:21+0000 [-] "127.0.0.1" - - [23/Oct/2021:01:25:21 +0000] "GET /v1/leases/analyzer_queue/acquire?client_id=anchore-engine-anchore-engine-catalog-5994fdf7c-brts2%3A15%3A139708130633472%3A&ttl=60 HTTP/1.1" 200 183 "-" "python-requests/2.26.0"
[user@bastion ~]$ 

@frumpleswift
Copy link

@Btodhunter do you need any additional information?

Btodhunter added a commit that referenced this issue Jan 12, 2024
* a customer pointed out an error in a job in the helm chart enterprise 1.0.0 in ZD 4786.
* Updated the chart version and made the change from ZD 4786 to the templates pre-upgrade
* remove path to certs dir as its included in env var
* update test snapshots

---------

Signed-off-by: Brady Todhunter <[email protected]>
Co-authored-by: Brady Todhunter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants