Juntai Observability Python
juntai-observability is Juntai's side-effect-free Python integration
for standard OpenTelemetry logs, metrics, traces, and W3C propagation. It owns
bootstrap, correlation conventions, redaction, bounded metric attributes, and
deterministic test utilities. It does not own telemetry storage, queries,
dashboards, backend credentials, product health semantics, or usage metering.
Install and configure
python -m pip install 'juntai-observability>=2,<3'
Configure exactly once at the application composition root. Importing the package does not install providers, replace logging classes, register exporters, start threads, or register shutdown hooks.
from juntai.observability import ObservabilityConfig, configure_observability
observability = configure_observability(
ObservabilityConfig.from_env(
service_namespace="juntai.axiom",
service_name="driver",
service_version="2.4.1",
metric_attribute_allowlist={
"axiom.execution.requests": {"result", "mode"},
},
)
)
logger = observability.logger(__name__)
tracer = observability.tracer(__name__)
meter = observability.meter(__name__)
try:
run_service()
finally:
observability.shutdown(timeout=5.0)
Repeated identical configuration returns the same runtime. A conflicting
configuration or configuration after shutdown raises
ObservabilityConfigurationError during startup.
Environment contract
OTEL_EXPORTER_OTLP_ENDPOINTnormally points to the platform sidecar athttp://127.0.0.1:4318.OTEL_EXPORTER_OTLP_PROTOCOLishttp/protobuforgrpc.OTEL_SERVICE_NAMEis the registered service name.OTEL_RESOURCE_ATTRIBUTESsuppliesservice.namespace,service.version,deployment.environment.name, and optionallyservice.instance.idandjuntai.artifact.digest.OTEL_TRACES_SAMPLERandOTEL_TRACES_SAMPLER_ARGcome from the environment profile.
Application containers do not receive central backend credentials. Kubernetes resource attributes are added by the Collector, not accepted from application environment parsing.
Logging and correlation
ObservabilityRuntime.logger(name) returns a standard logging.Logger with an
OpenTelemetry handler attached only to that logger. Active trace_id and
span_id are supplied by OpenTelemetry. Structured extras are redacted and
bounded before export.
from juntai.observability import bind_context
with bind_context(
tenant_id=verified_tenant_id,
tenant_verified=True,
application_id=application_id,
workflow_id=workflow_id,
execution_id=execution_id,
):
with tracer.start_as_current_span("axiom.execute"):
logger.info("execution completed", extra={"execution.result": "succeeded"})
Only approved correlation baggage is injected or extracted. Tenant context must be explicitly verified. Secret-like keys and values, connection strings, credentials, and oversized values are removed or bounded before export.
Metrics
Meters and instruments implement standard OpenTelemetry interfaces. Metric points are dropped without failing the business operation when they contain prohibited high-cardinality keys, undeclared keys for a configured instrument, oversized values, too many labels, or more distinct attribute sets than the configured bound.
requests = meter.create_counter(
"axiom.execution.requests",
unit="{request}",
description="Execution requests accepted by the driver",
)
requests.add(1, {"result": "accepted", "mode": "batch"})
Do not use tenant, user, application, workflow, execution, request, trace, raw URL, exception message, or free-form text values as metric attributes.
Deterministic tests
InMemoryObservability uses real SDK providers with in-memory exporters and no
network or process-global mutation.
from juntai.observability import InMemoryObservability
telemetry = InMemoryObservability(
service_namespace="juntai.axiom",
service_name="driver",
)
with telemetry.tracer("test").start_as_current_span("axiom.execute"):
telemetry.logger("test").warning("completed")
assert telemetry.logs[0].trace_id == telemetry.spans[0].trace_id
telemetry.shutdown()
The machine-readable convention is
conventions/observability.v1.json. See
DEVELOPMENT.md for build, contract, and real Collector
acceptance commands.
Compatibility and ownership
Generic v1 imports from juntai.core.observability_tools remain as an explicit,
deprecated adapter for one release. The adapter never replaces the process-wide
logger class. Usage APIs are not compatible exports; install juntai-usage.
Raw telemetry is explored with the selected backend's native interfaces. Product domains own dashboards, alert interpretation, durable business state, and health actions.
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 juntai_observability-2.0.4.tar.gz.
File metadata
- Download URL: juntai_observability-2.0.4.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68b8ff5ebb192f46268276f18bf752ddacb93d0c2605a5a057e1234985a3fd7
|
|
| MD5 |
a01ea477cad3a44be7550eb7f1171d1e
|
|
| BLAKE2b-256 |
242502708072d6540d2814f906ad74af56a7b68e5ebd68d89331851361baf043
|
Provenance
The following attestation bundles were made for juntai_observability-2.0.4.tar.gz:
Publisher:
publish.yml on zephytiju/JuntaiObservabilityTools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juntai_observability-2.0.4.tar.gz -
Subject digest:
e68b8ff5ebb192f46268276f18bf752ddacb93d0c2605a5a057e1234985a3fd7 - Sigstore transparency entry: 2459117993
- Sigstore integration time:
-
Permalink:
zephytiju/JuntaiObservabilityTools@405c0c30c4348ca2743fa81d2740649457165f5d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@405c0c30c4348ca2743fa81d2740649457165f5d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file juntai_observability-2.0.4-py3-none-any.whl.
File metadata
- Download URL: juntai_observability-2.0.4-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d51a63c155f9ddb3f36480e0d2ff178cb1221a92d588659938fb3b23ec6791c9
|
|
| MD5 |
037e2c3d4c2084b10d5102cfa2620934
|
|
| BLAKE2b-256 |
b5a0762584ded2e90840275fdc37effdabe279ef654141923213c5d44a9697be
|
Provenance
The following attestation bundles were made for juntai_observability-2.0.4-py3-none-any.whl:
Publisher:
publish.yml on zephytiju/JuntaiObservabilityTools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
juntai_observability-2.0.4-py3-none-any.whl -
Subject digest:
d51a63c155f9ddb3f36480e0d2ff178cb1221a92d588659938fb3b23ec6791c9 - Sigstore transparency entry: 2459118085
- Sigstore integration time:
-
Permalink:
zephytiju/JuntaiObservabilityTools@405c0c30c4348ca2743fa81d2740649457165f5d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@405c0c30c4348ca2743fa81d2740649457165f5d -
Trigger Event:
workflow_dispatch
-
Statement type: