-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: Test command line result before comparing it to Gunicorn master name #19310
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Can you add a changelog for this change? |
f3228c0
to
2be1499
Compare
@HadhemiDD I have added a changelog line for this change. |
2be1499
to
88b99e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dax thanks for the contribution!
Could you add a test for this scenario please?
Also, let's add a changelog entry according to the integrations-core
tab in these guidelines.
88b99e1
to
ab72542
Compare
@iliakur I have added a test and used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dax good stuff, thanks!
Review from iliakur is dismissed. Related teams and files:
- agent-integrations
- gunicorn/datadog_checks/gunicorn/gunicorn.py
…name (#19310) * fix: Test command line result before comparing it to Gunicorn master name * Update gunicorn/datadog_checks/gunicorn/gunicorn.py --------- Co-authored-by: Sarah Witt <sarah.witt@datadoghq.com>
What does this PR do?
It tests the result of
psutil.cmdline()
before comparing its first element to the Gunicorn master process name.Motivation
On Linux
psutil.cmdline()
may return an empty array (e.g. for kernel processes) makingcmdline()[0]
fail with anIndexError: list index out of range
error.Even if the
IndexError
was caught, it generates a lot of noise in logs. Moreover, as there is an attached exception to aDEBUG
log, Datadog classifies it as an error which is misleading.Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged