Skip to main content

Shared observability primitives (health models, logging, middleware, Sentry, Prometheus) for the Juniper ML platform

Project description

juniper-observability

Shared observability primitives for the Juniper ML platform.

What's in here

  • Health models (DependencyStatus, ReadinessResponse) — Pydantic models for the standard /v1/health/ready response shape used by every Juniper server.
  • Probe utility (probe_dependency) — synchronous HTTP health-check helper.
  • Logging (JuniperJsonFormatter, configure_logging) — structured-JSON logging with request_id propagation.
  • Middleware (RequestIdMiddleware, PrometheusMiddleware) — Starlette middlewares applied by every Juniper server. The Prometheus middleware bounds label cardinality per the R1.1 contract.
  • Constants (UNMATCHED_ENDPOINT_LABEL, READINESS_HEADER, LIVENESS_TICK_BUDGET_MS, LIVENESS_STALENESS_SECONDS) — pinned values from the R1.1, R1.2, and R1.3 cross-service contracts.
  • Prometheus utilities (get_prometheus_app, set_build_info).
  • Sentry init (configure_sentry) — with the SEC-10 before_send hook always installed.

Install

pip install juniper-observability                          # core only
pip install "juniper-observability[prometheus]"            # + Prometheus middleware/utilities
pip install "juniper-observability[sentry]"                # + Sentry init
pip install "juniper-observability[all]"                   # everything

Per-service metrics stay in each repo

This package intentionally exposes only cross-cutting observability infrastructure. Service-specific metric definitions (training-loop counters, dataset-gen histograms, websocket gauges, etc.) live in their owning repo and use the lazy-init pattern with prometheus_client directly.

Design + migration

See notes/code-review/METRICS_MONITORING_R2.1_SHARED_OBSERVABILITY_DESIGN_2026-04-28.md in the parent juniper-ml repo for the full design and the 5-PR migration sequence.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juniper_observability-0.1.1a0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juniper_observability-0.1.1a0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file juniper_observability-0.1.1a0.tar.gz.

File metadata

  • Download URL: juniper_observability-0.1.1a0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for juniper_observability-0.1.1a0.tar.gz
Algorithm Hash digest
SHA256 7d036b680f69d6dc957204c3a85c74a5be7cc9a06a9427921a0f68a44c8ec738
MD5 2bc16418a6d00ca77485f4b3afd98514
BLAKE2b-256 25efecbd7f1e7d50b65c06e5ca8f4e7ebebe4f6c98de1d9f0457eed32701480c

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_observability-0.1.1a0.tar.gz:

Publisher: publish-observability.yml on pcalnon/juniper-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file juniper_observability-0.1.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_observability-0.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 64e5d572ac0623f73703d42e97f7da07d70addc588d0eba1bcc293ec226ba455
MD5 39047a215276c56660830787313c67f7
BLAKE2b-256 d3789b77fe657eee909d3589770431a76bba6d08e188d9fab2a682b715d45d5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_observability-0.1.1a0-py3-none-any.whl:

Publisher: publish-observability.yml on pcalnon/juniper-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page