2.5 KiB
2.5 KiB
Python Services
Code Style
Code style must be enforced using flake8.3
[flake8] application-import-names = PACKAGE_NAME,tests exclude = build,env import-order-style = pycharm
Requirements
Uncaught errors are logged and alerted via Sentry
-
sentry-sdk
from sentry_sdk import init init(SENTRY_DSN)
A status endpoint is exposed
The endpoint should be provide the following fields:
- application
- The name of the service
- environment
- The operating environment the instance of the service is running in (i.e. "development", "testing", "staging" or "production")
- status
- Current service status (e.g.: "ok", "starting")
- version
- Packaged version of the service instance
- python_version
- The python version running the service instance
(
platform.python_version()
) The endpoint should return200
when the service is healthy, and503
if the service is not ready to serve requests.
The service self-hosts its API documentation
An OpenAPI specification is hosted using ReDoc at the root service URL.4
Test coverage reports are available in SonarQube
Structured logging
json-scribe
Provides consistent error responses
json-problem