Skip to main content

o11y-one

The Python client for the O11y One API. A thin, hand-written layer over the generated o11y-one-api-agentic package.

Install

uv add o11y-one        # or: pip install o11y-one

Use

import os

from o11y_one.sdk import O11yClient, Disposition, classify
from o11y_one.agentic.v1.evaluation_pb2 import ListEvaluationDefinitionsRequest
from o11y_one.agentic.v1.evaluation_connect import AgenticEvaluationServiceClientSync

o11y = O11yClient(
    base_url="https://grpc.o11y.one",
    credential=os.environ["O11Y_API_KEY"],  # o11y_mach.<selector>.<secret>
    org_id=os.environ["O11Y_ORG_ID"],
)

evals = o11y.service_sync(AgenticEvaluationServiceClientSync)
try:
    defs = evals.list_evaluation_definitions(ListEvaluationDefinitionsRequest())
except Exception as err:  # noqa: BLE001 - classify sorts it out
    failure = classify(err)
    if failure.disposition is Disposition.INSUFFICIENT_SCOPE:
        raise SystemExit(f"credential is missing scope {failure.missing_scope}") from err
    raise

What is here, and what deliberately is not

Three modules and nothing else:

module responsibility
o11y_one.sdk.client transport construction, credential and scoping header injection
o11y_one.sdk.auth the credential wire format and local structural validation
o11y_one.sdk.errors the failure taxonomy: reauthenticate / insufficient-scope / version-skew / retry / unclassified

Service methods are not wrapped. o11y-one-api-agentic already ships a client class per service; a hand-written facade over all of them would be a second API surface to keep in sync with the proto, and it would rot the first time a field is added upstream. Import the generated client class and hand it to O11yClient.service_sync() / O11yClient.service().

The distinction this package exists to preserve

UNAUTHENTICATED and PERMISSION_DENIED are different problems:

  • UNAUTHENTICATED — the credential is absent, malformed, unknown, expired, or revoked. Re-auth. Retrying cannot change the answer.
  • PERMISSION_DENIED — the credential is fine; it lacks a scope (the server names which one) or it was presented to a non-machine surface.

classify() keeps them apart, along with UNAVAILABLE (auth backend down — retry with backoff) and INVALID_ARGUMENT (SDK/server version skew). Collapsing these into a single "auth error" is the failure mode this module exists to prevent.

Credentials

A machine credential is o11y_mach.<selector>.<secret>, presented in the x-o11y-key header. It is:

  • returned exactly once, by CreateMachineCredential. There is no read-back RPC and no recovery path — lose it and you rotate.
  • rotated create-then-revoke, not atomically. A principal may hold several active credentials at once, which is what makes zero-downtime rotation work: create the new one, deploy it, then revoke the old.
  • revoked effective on the next request, not on a TTL boundary.
  • expiring at +365 days by default, capped at three years.

Never send it as authorization: Bearer — that path carries the browser session JWT and a machine credential presented there is rejected.

Release files for o11y-one 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for o11y-one 0.1.2
File Size Uploaded
o11y_one-0.1.2.tar.gz 22.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for o11y-one 0.1.2
File Interpreter ABI Platform
o11y_one-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 48.5 kB

Release files / o11y_one-0.1.2.tar.gz

Download URL o11y_one-0.1.2.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
714cc9de2944dd858b7a29b686c95bfbbf8de7b6be8b4047030b4632aedbae02
BLAKE2b-256 checksum
How to use checksums
c0c0f6cca99f43e4f4cc46d1c1a13809c64caab47e4a1a751cc49c1e7a9b62d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / o11y_one-0.1.2-py3-none-any.whl

Download URL o11y_one-0.1.2-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73790faf221f05fd050f13196ffb2aa64e7f1f69620285748a0395351cb536e8
BLAKE2b-256 checksum
How to use checksums
055db5023ae4ba9d535eb65325708ab3b2f207c2145bb9fa5376cb0dc1774108
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page