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

Remote rendering: Improve error handling, logging and metrics #92

Merged
merged 3 commits into from
Jan 29, 2020

Conversation

marefr
Copy link
Member

@marefr marefr commented Jan 28, 2020

Had completely screwed up the exception handling when running as HTTP service, basically swallowed the exception and tried to log it, but the logger was badly implemented. This is the reason why metrics only showed 200 response statuses and nothing else :)

Changes:

  • Service: Don't swallow exceptions and fix logging of parameters
  • Metrics: Use status 499 when client close the connection
    • When Grafana cancel a render request status 499 is used for
      the http_request_duration_seconds_* metrics instead of 200.
      499 is a non-standard code and is used by Nginx and I think
      it's okay to use this here since the code is not returned
      to any client.
  • Docker: Set NODE_ENV=production
    • not sure this makes any difference, but couldn't hurt
  • Changed request logging to use debug level if status < 400 and error if >= 400

When Grafana cancel a render request status 499 is used for
the http_request_duration_seconds_* metrics instead of 200.
499 is a non-standard code and is used by Nginx and I think
it's okay to use this here since the code is not returned
to any client.
@marefr marefr requested a review from DanCech January 28, 2020 22:39
@marefr marefr merged commit 19ffd96 into master Jan 29, 2020
@marefr marefr deleted the service_fixes branch January 29, 2020 09:29
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

Successfully merging this pull request may close these issues.

2 participants