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/readyresponse shape used by every Juniper server. - Probe utility (
probe_dependency) — synchronous HTTP health-check helper. - Logging (
JuniperJsonFormatter,configure_logging) — structured-JSON logging withrequest_idpropagation. - 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-10before_sendhook 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/legacy/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 (archived to notes/legacy/ 2026-05-05 after the METRICS-MON program closed).
Release workflow
juniper-observability is versioned and published independently from the root juniper-ml meta-package.
| Package | Tag pattern | Workflow | Build root |
|---|---|---|---|
juniper-ml |
v* GitHub releases |
.github/workflows/publish.yml |
repository root |
juniper-observability |
juniper-observability-v* tag pushes |
.github/workflows/publish-observability.yml |
juniper-observability/ |
The observability workflow builds an sdist and wheel from this subdirectory, publishes first to TestPyPI through OIDC trusted publishing, retries installation from TestPyPI to tolerate index lag, imports juniper_observability as the smoke test, then promotes the same artifact to PyPI after the pypi environment gate.
Operational constraints:
- Trusted publishers must be configured on both TestPyPI and PyPI for project
juniper-observability, workflow.github/workflows/publish-observability.yml, and environmentstestpypi/pypi. - The publish steps set
verbose: trueonpypa/gh-action-pypi-publishso upload failures include the package-index response body. - Keep
pyproject.tomlandjuniper_observability/_version.pyin sync before tagging; the workflow's import smoke test prints__version__, but it does not compare it to the built artifact version.
See notes/releases/RELEASE_WALKTHROUGH_juniper-ml-v0.4.1_juniper-observability-v0.1.1a_2026-04-28.md for the full release runbook and trusted-publisher troubleshooting notes.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file juniper_observability-0.2.0.tar.gz.
File metadata
- Download URL: juniper_observability-0.2.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be3bc2d06cd2c933a0cd4c659bdc0ef3cf100898ab72b30aa5d5b3e731c19a41
|
|
| MD5 |
b2b41b49263e1921439c1073ad4d4e02
|
|
| BLAKE2b-256 |
6ac00ffb05ad95c0e5884fb7a0b8c4bbad8bf7c3b527f18a439fa4e801869946
|
Provenance
The following attestation bundles were made for juniper_observability-0.2.0.tar.gz:
Publisher:
publish-observability.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_observability-0.2.0.tar.gz -
Subject digest:
be3bc2d06cd2c933a0cd4c659bdc0ef3cf100898ab72b30aa5d5b3e731c19a41 - Sigstore transparency entry: 1447103615
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@e7106c39f5542a9add3ebc68bdf5a8b3bc0b0bd8 -
Branch / Tag:
refs/tags/juniper-observability-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-observability.yml@e7106c39f5542a9add3ebc68bdf5a8b3bc0b0bd8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file juniper_observability-0.2.0-py3-none-any.whl.
File metadata
- Download URL: juniper_observability-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45f3f481e6cbc4b4a28099025b1346ffb86d59f7385674fe8287e2aa524364e0
|
|
| MD5 |
6cea211086d5fd128a9a88547daa0d13
|
|
| BLAKE2b-256 |
a68e19cf033ce75381a633ea3d8f7f7096004967e79cd388d95785d62629f258
|
Provenance
The following attestation bundles were made for juniper_observability-0.2.0-py3-none-any.whl:
Publisher:
publish-observability.yml on pcalnon/juniper-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juniper_observability-0.2.0-py3-none-any.whl -
Subject digest:
45f3f481e6cbc4b4a28099025b1346ffb86d59f7385674fe8287e2aa524364e0 - Sigstore transparency entry: 1447103740
- Sigstore integration time:
-
Permalink:
pcalnon/juniper-ml@e7106c39f5542a9add3ebc68bdf5a8b3bc0b0bd8 -
Branch / Tag:
refs/tags/juniper-observability-v0.2.0 - Owner: https://github.com/pcalnon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-observability.yml@e7106c39f5542a9add3ebc68bdf5a8b3bc0b0bd8 -
Trigger Event:
push
-
Statement type: