Skip to content

0.7.0

Choose a tag to compare

@shpaker shpaker released this 12 Sep 17:02
· 9 commits to main since this release

Added

  • Ready-made probes, importable from probirka: TcpProbe (no dependencies), PostgresAsyncpgProbe, RedisProbe, HttpHttpxProbe, HttpHttpx2Probe, HttpAiohttpProbe, KafkaAiokafkaProbe, RabbitmqAiopikaProbe, MongoPymongoProbe, MongoMotorProbe. Each accepts an existing client (or a zero-argument function returning one) or a connection string (#8)
  • make_asgi_app — a generic ASGI 3 application serving the same JSON body and the same options as the framework adapters. It needs no third-party package at all, so unlike the other make_* names it is always importable: register it as a route (Route('/health', app, methods=['GET', 'HEAD']) in Starlette), mount it (app.mount(...) in FastAPI, asgi('/health', is_mount=True) in Litestar), or serve it on its own port with uvicorn health:health_app (#10)
  • MissingDependencyError (an ImportError) raised on access to a probe or adapter whose client library is not installed; a library that is installed but too old keeps its original error (#8)
  • ProbeFailure — exception for "the service answered, but not in a healthy way"; its message goes to ProbeResult.error (#8)
  • CallableProbe is exported from the probirka package; names that need a third-party package are resolved lazily and listed in __all__ only when their package is installed (#8)

Changed

  • Minimum supported Python is 3.11; the test matrix covers 3.11 through 3.15 (#9)
  • started_at is timezone-aware in the local zone of the host, so to_dict() and every HTTP integration now emit an ISO 8601 timestamp with a UTC offset (#9)
  • elapsed and the TTL cache are measured with time.monotonic() instead of the wall clock, so clock adjustments no longer distort durations or cache expiry (#9)
  • CallableProbe falls back to the class name for callables without __name__ (functools.partial, objects with __call__) instead of raising AttributeError (#9)
  • groups and with_groups accept any Sequence[str], not just list (#9)
  • Type checking moved from mypy to ty; annotations use PEP 585/604 syntax throughout (#9)
  • Framework adapter modules are private now (probirka._ext.*); make_fastapi_endpoint, make_aiohttp_endpoint and make_django_view are imported from probirka as before, resolved lazily (#8)
  • probirka stays dependency-free; client libraries and frameworks are installed separately (no extras) (#8)

Fixed

  • ProbeResult.elapsed no longer includes the time spent looking up the TTL cache (#9)

Full changelog: https://github.com/appKODE/probirka/blob/main/CHANGELOG.md