Skip to content

Commit

Permalink
Merge pull request #174 from mormahr/dont-sample-health-route
Browse files Browse the repository at this point in the history
Disable samping for /health endpoint
  • Loading branch information
mormahr authored Sep 15, 2021
2 parents 6adf39a + afb7646 commit dbc6d93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Summary: WeasyPrint v53, ARM multi-arch and much smaller image.
[#170](https://github.com/mormahr/pdf-service/pull/170)
- Using [tini](https://github.com/krallin/tini) as the entrypoint
[#134](https://github.com/mormahr/pdf-service/pull/134)
- Disabled Sentry performance sampling of `/health` endpoint
[#174](https://github.com/mormahr/pdf-service/pull/174)

## [1.1.0] - 2021-09-01
**WeasyPrint: v52.5**
Expand Down
6 changes: 5 additions & 1 deletion pdf_service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from sentry_sdk import init
from sentry_sdk import init, configure_scope
from flask import Flask, make_response
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
Expand Down Expand Up @@ -33,6 +33,10 @@ def generate_pdf():

@pdf_service.route('/health', methods=['GET'])
def health():
with configure_scope() as scope:
if scope.transaction:
scope.transaction.sampled = False

response = make_response("Healthy")
return response

Expand Down

0 comments on commit dbc6d93

Please sign in to comment.