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

Resolve unexpected errors when statuses other than 'running' or 'idle' is received #9428

Merged
merged 8 commits into from
May 31, 2021

Conversation

ian28223
Copy link
Contributor

@ian28223 ian28223 commented May 27, 2021

What does this PR do?

Resolves following errors:

Unexpected error running `query_connection_overview`: 'receiving'
Unexpected error running `query_connection_overview`: 'sending'

Motivation

AGENT-6213

Additional Notes

traceback added to the code for troubleshooting. Original error did not mention KeyError

Traceback (most recent call last):

File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sap_hana/sap_hana.py", line 95, in check
   query_method()
File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sap_hana/sap_hana.py", line 191, in query_connection_overview

db_counts[(conn['db_name'], conn['host'], conn['port'])][conn['status'].lower()] += conn['total']

KeyError: 'receiving'

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

ian28223 and others added 4 commits May 20, 2021 15:35
Possible to receive undocumented status e.g. receiving,sending
@ian28223 ian28223 force-pushed the ian.bucad/sap_hana_tb branch from cb68591 to a984d28 Compare May 28, 2021 03:06
@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #9428 (c31afae) into master (2fc7c56) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Flag Coverage Δ
sap_hana 93.09% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sap_hana/tests/metrics.py 100.00% <ø> (ø)
sap_hana/datadog_checks/sap_hana/sap_hana.py 88.60% <100.00%> (+0.13%) ⬆️
sap_hana/tests/test_unit.py 100.00% <100.00%> (ø)

FlorianVeaux
FlorianVeaux previously approved these changes May 28, 2021
sap_hana/datadog_checks/sap_hana/sap_hana.py Outdated Show resolved Hide resolved
sap_hana/datadog_checks/sap_hana/sap_hana.py Outdated Show resolved Hide resolved
Co-authored-by: Florian Veaux <florian.veaux@datadoghq.com>
@ian28223 ian28223 requested a review from FlorianVeaux May 28, 2021 14:30
@FlorianVeaux FlorianVeaux merged commit c0d4e94 into master May 31, 2021
@FlorianVeaux FlorianVeaux deleted the ian.bucad/sap_hana_tb branch May 31, 2021 07:24
github-actions bot pushed a commit that referenced this pull request May 31, 2021
…' is received (#9428)

* traceback error

* fix KeyError

Possible to receive undocumented status e.g. receiving,sending

* Update metadata

* typo

* typo

* adjust test

* Apply suggestions from code review

Co-authored-by: Florian Veaux <florian.veaux@datadoghq.com>

* adjust test

Co-authored-by: Florian Veaux <florian.veaux@datadoghq.com> c0d4e94
FlorianVeaux added a commit that referenced this pull request May 31, 2021
ofek pushed a commit that referenced this pull request Jun 1, 2021
@ofek ofek restored the ian.bucad/sap_hana_tb branch June 1, 2021 13:18
@ian28223 ian28223 deleted the ian.bucad/sap_hana_tb branch June 11, 2021 02:14
@ian28223 ian28223 restored the ian.bucad/sap_hana_tb branch October 4, 2021 23:40
@ofek ofek deleted the ian.bucad/sap_hana_tb branch January 12, 2022 00:28
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