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

Raise exception to report when openmetrics process fails #5392

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

Simwar
Copy link
Contributor

@Simwar Simwar commented Jan 6, 2020

What does this PR do?

Raise exception when openmetrics process method throws an exception, so the check reports it in the status of the agent.

Motivation

The integration reports OK even though there is a connection issue.

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

@Simwar Simwar requested a review from a team as a code owner January 6, 2020 14:31
@@ -32,5 +32,6 @@ def process(self, scraper_config, metric_transformers=None):
super(LinkerdCheck, self).process(scraper_config, metric_transformers=metric_transformers)
except Exception:
self.gauge(self.HEALTH_METRIC, 1, tags=tags)
raise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also log a message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't raise alone raises the same exception?
Reading this: https://docs.python.org/3/tutorial/errors.html#handling-exceptions I thought it would. I wanted to keep the exact same exception to display in the status.

Copy link
Contributor

@ChristineTChen ChristineTChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@ChristineTChen ChristineTChen merged commit 5d023de into master Jan 6, 2020
@ChristineTChen ChristineTChen deleted the raise_exception_linkerd branch January 6, 2020 16:00
@ChristineTChen ChristineTChen changed the title raise exception when openmetrics process fails so check reports it Raise exception to report when openmetrics process fails Jan 6, 2020
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.

2 participants