trazio-telemetry 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: trazio-telemetry
3
+ Version: 0.3.0
4
+ Summary: Scoped telemetry, artifact, investigation, and semantic-query SDK
5
+ Author-email: Trazio <vc@hyperlake.cloud>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://hyperlake.cloud
8
+ Project-URL: Documentation, https://hyperlake.cloud/docs
9
+ Project-URL: Repository, https://github.com/cerebrixos-org/sovereign-telemetry-platform
10
+ Keywords: opentelemetry,otlp,openinference,agents,temporal,langflow
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Topic :: System :: Monitoring
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: certifi>=2024.2.2
19
+ Provides-Extra: temporal
20
+ Requires-Dist: temporalio[opentelemetry]>=1.20; extra == "temporal"
21
+ Provides-Extra: langflow
22
+ Requires-Dist: langflow>=1.6; extra == "langflow"
23
+ Provides-Extra: otel
24
+ Requires-Dist: opentelemetry-api>=1.30; extra == "otel"
25
+ Requires-Dist: opentelemetry-sdk>=1.30; extra == "otel"
26
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.30; extra == "otel"
27
+ Provides-Extra: dev
28
+ Requires-Dist: build>=1.2; extra == "dev"
29
+ Requires-Dist: pytest>=8; extra == "dev"
30
+ Requires-Dist: twine>=6; extra == "dev"
31
+
32
+ # Trazio Telemetry SDK for Python
33
+
34
+ Version 0.3.0 renames the package from `hyperlake-telemetry`; the API is unchanged.
35
+ See [SDK integration and release status](https://github.com/cerebrixos-org/sovereign-telemetry-platform/blob/main/sovereign-telemetry-platform/sdk/README.md).
36
+
37
+ `trazio-telemetry` sends standards-compatible OTLP/HTTP JSON, attaches
38
+ events and immutable artifacts, manages tenant-editable settings, and performs
39
+ scoped event, artifact, video, Run, and evidence-graph investigations. It does not replace the
40
+ OpenTelemetry SDK: applications with existing instrumentation should continue
41
+ using their normal exporter and use this package only for run context, stable
42
+ event identity, evaluations, and artifact attachment.
43
+
44
+ ```bash
45
+ pip install trazio-telemetry
46
+ ```
47
+
48
+ ```python
49
+ from trazio_telemetry import Client, Privacy
50
+
51
+ client = Client(
52
+ base_url="https://us.hyperlake.cloud",
53
+ protocol_token="write-only-protocol-token",
54
+ tenant_jwt="short-lived-jwks-jwt",
55
+ privacy=Privacy(capture_content=False),
56
+ )
57
+
58
+ with client.run("invoice-agent", goal_id="goal-42") as run:
59
+ with run.span("lookup-account", kind="RETRIEVER"):
60
+ pass
61
+ run.evaluate("groundedness", score=0.97, label="pass")
62
+
63
+ client.flush()
64
+
65
+ result = client.semantic_query(
66
+ "Show critical robot video and related faults from the last 2 hours"
67
+ )
68
+
69
+ detection = client.analyze_live_frame(
70
+ "./frame.jpg",
71
+ stream_session_id="camera-session-17",
72
+ frame_id="frame-42",
73
+ device_id="robot-17",
74
+ )
75
+ ```
76
+
77
+ `analyze_live_frame()` uses the immutable model profile pinned to the JWT's
78
+ pipeline. It requires a short-lived JWT with `live:analyze` and `event:ingest`.
79
+ The response is a factual object-detection result; the attached live Rule Packs
80
+ determine whether it becomes an alert or notification.
81
+
82
+ The JWT determines tenant and pipeline routing. Explicit routing IDs are
83
+ optional with a JWT and are rejected when they conflict with its claims. Local
84
+ claim decoding is not signature verification; the regional service verifies
85
+ signature, issuer, audience, expiry, permissions, tenant, and pipeline for every
86
+ request.
87
+ Prompt, response, tool argument, and tool result content is suppressed by
88
+ default. Set `capture_content=True` only after applying an approved data policy.
89
+
90
+ See the repository integration guides for Temporal, Langflow, OpenInference,
91
+ Collector, and Alloy examples.
92
+
93
+ ## Reliable semantic queries
94
+
95
+ `semantic_query()` creates and validates a versioned, bounded query plan before
96
+ calling any endpoint. Plans may target event retrieval, artifact/vector search,
97
+ and evidence-graph traversal, but cannot contain tenant, pipeline, URL, token,
98
+ SQL, or authorization fields. Every response includes the plan hash and scope
99
+ provenance.
100
+
101
+ `DeterministicSemanticPlanner` works without an LLM. `ModelSemanticPlanner`
102
+ accepts any callable that returns a JSON-like object; unsafe or invalid model
103
+ output falls back to the deterministic plan. A model therefore interprets user
104
+ intent but cannot expand authorization or execute arbitrary queries.
105
+
106
+ Artifact and video retrieval uses configured vector embeddings. Event retrieval
107
+ is bounded structured/lexical retrieval, while graph results come from recorded
108
+ scoped evidence edges. These signals remain separate and similarity is not
109
+ treated as causation.
110
+
111
+ The client also exposes event listing/search, artifact search/upload/download,
112
+ typed telemetry, video playback/timeline, Runs, evidence graphs, tenant config,
113
+ protocol-token rotation, and Rule Pack validate/dry-run/publish helpers.
@@ -0,0 +1,82 @@
1
+ # Trazio Telemetry SDK for Python
2
+
3
+ Version 0.3.0 renames the package from `hyperlake-telemetry`; the API is unchanged.
4
+ See [SDK integration and release status](https://github.com/cerebrixos-org/sovereign-telemetry-platform/blob/main/sovereign-telemetry-platform/sdk/README.md).
5
+
6
+ `trazio-telemetry` sends standards-compatible OTLP/HTTP JSON, attaches
7
+ events and immutable artifacts, manages tenant-editable settings, and performs
8
+ scoped event, artifact, video, Run, and evidence-graph investigations. It does not replace the
9
+ OpenTelemetry SDK: applications with existing instrumentation should continue
10
+ using their normal exporter and use this package only for run context, stable
11
+ event identity, evaluations, and artifact attachment.
12
+
13
+ ```bash
14
+ pip install trazio-telemetry
15
+ ```
16
+
17
+ ```python
18
+ from trazio_telemetry import Client, Privacy
19
+
20
+ client = Client(
21
+ base_url="https://us.hyperlake.cloud",
22
+ protocol_token="write-only-protocol-token",
23
+ tenant_jwt="short-lived-jwks-jwt",
24
+ privacy=Privacy(capture_content=False),
25
+ )
26
+
27
+ with client.run("invoice-agent", goal_id="goal-42") as run:
28
+ with run.span("lookup-account", kind="RETRIEVER"):
29
+ pass
30
+ run.evaluate("groundedness", score=0.97, label="pass")
31
+
32
+ client.flush()
33
+
34
+ result = client.semantic_query(
35
+ "Show critical robot video and related faults from the last 2 hours"
36
+ )
37
+
38
+ detection = client.analyze_live_frame(
39
+ "./frame.jpg",
40
+ stream_session_id="camera-session-17",
41
+ frame_id="frame-42",
42
+ device_id="robot-17",
43
+ )
44
+ ```
45
+
46
+ `analyze_live_frame()` uses the immutable model profile pinned to the JWT's
47
+ pipeline. It requires a short-lived JWT with `live:analyze` and `event:ingest`.
48
+ The response is a factual object-detection result; the attached live Rule Packs
49
+ determine whether it becomes an alert or notification.
50
+
51
+ The JWT determines tenant and pipeline routing. Explicit routing IDs are
52
+ optional with a JWT and are rejected when they conflict with its claims. Local
53
+ claim decoding is not signature verification; the regional service verifies
54
+ signature, issuer, audience, expiry, permissions, tenant, and pipeline for every
55
+ request.
56
+ Prompt, response, tool argument, and tool result content is suppressed by
57
+ default. Set `capture_content=True` only after applying an approved data policy.
58
+
59
+ See the repository integration guides for Temporal, Langflow, OpenInference,
60
+ Collector, and Alloy examples.
61
+
62
+ ## Reliable semantic queries
63
+
64
+ `semantic_query()` creates and validates a versioned, bounded query plan before
65
+ calling any endpoint. Plans may target event retrieval, artifact/vector search,
66
+ and evidence-graph traversal, but cannot contain tenant, pipeline, URL, token,
67
+ SQL, or authorization fields. Every response includes the plan hash and scope
68
+ provenance.
69
+
70
+ `DeterministicSemanticPlanner` works without an LLM. `ModelSemanticPlanner`
71
+ accepts any callable that returns a JSON-like object; unsafe or invalid model
72
+ output falls back to the deterministic plan. A model therefore interprets user
73
+ intent but cannot expand authorization or execute arbitrary queries.
74
+
75
+ Artifact and video retrieval uses configured vector embeddings. Event retrieval
76
+ is bounded structured/lexical retrieval, while graph results come from recorded
77
+ scoped evidence edges. These signals remain separate and similarity is not
78
+ treated as causation.
79
+
80
+ The client also exposes event listing/search, artifact search/upload/download,
81
+ typed telemetry, video playback/timeline, Runs, evidence graphs, tenant config,
82
+ protocol-token rotation, and Rule Pack validate/dry-run/publish helpers.
@@ -0,0 +1,42 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "trazio-telemetry"
7
+ version = "0.3.0"
8
+ description = "Scoped telemetry, artifact, investigation, and semantic-query SDK"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "LicenseRef-Proprietary"
12
+ authors = [{name = "Trazio", email = "vc@hyperlake.cloud"}]
13
+ keywords = ["opentelemetry", "otlp", "openinference", "agents", "temporal", "langflow"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Topic :: System :: Monitoring",
20
+ ]
21
+ dependencies = ["certifi>=2024.2.2"]
22
+
23
+ [project.optional-dependencies]
24
+ temporal = ["temporalio[opentelemetry]>=1.20"]
25
+ langflow = ["langflow>=1.6"]
26
+ otel = [
27
+ "opentelemetry-api>=1.30",
28
+ "opentelemetry-sdk>=1.30",
29
+ "opentelemetry-exporter-otlp-proto-http>=1.30",
30
+ ]
31
+ dev = ["build>=1.2", "pytest>=8", "twine>=6"]
32
+
33
+ [project.urls]
34
+ Homepage = "https://hyperlake.cloud"
35
+ Documentation = "https://hyperlake.cloud/docs"
36
+ Repository = "https://github.com/cerebrixos-org/sovereign-telemetry-platform"
37
+
38
+ [tool.setuptools.packages.find]
39
+ where = ["src"]
40
+
41
+ [tool.pytest.ini_options]
42
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,20 @@
1
+ """Deprecated alias: the SDK is now ``trazio_telemetry`` (package ``trazio-telemetry``)."""
2
+
3
+ import sys
4
+ import warnings
5
+
6
+ import trazio_telemetry as _trazio
7
+ from trazio_telemetry import * # noqa: F401,F403
8
+ from trazio_telemetry import __all__, __version__ # noqa: F401
9
+ from trazio_telemetry import client, integrations, semantic_query # noqa: F401
10
+
11
+ warnings.warn(
12
+ "hyperlake_telemetry is renamed to trazio_telemetry; update your imports",
13
+ DeprecationWarning,
14
+ stacklevel=2,
15
+ )
16
+
17
+ for _name in ("client", "semantic_query", "integrations", "integrations.openinference", "integrations.temporal"):
18
+ __import__(f"trazio_telemetry.{_name}")
19
+ sys.modules[f"{__name__}.{_name}"] = sys.modules[f"trazio_telemetry.{_name}"]
20
+ del _name, _trazio
@@ -0,0 +1,16 @@
1
+ """Standards-first OTLP telemetry and artifact helpers."""
2
+
3
+ from .client import AdminClient, Client, Privacy, Run, Span, stable_event_id
4
+ from .semantic_query import (
5
+ DeterministicSemanticPlanner,
6
+ ModelSemanticPlanner,
7
+ deterministic_plan,
8
+ normalize_semantic_query,
9
+ )
10
+
11
+ __all__ = [
12
+ "AdminClient", "Client", "Privacy", "Run", "Span", "stable_event_id",
13
+ "DeterministicSemanticPlanner", "ModelSemanticPlanner",
14
+ "deterministic_plan", "normalize_semantic_query",
15
+ ]
16
+ __version__ = "0.3.0"