Docs target current release v0.7.0.v0.7.1 is under review

OpenTelemetry interoperability

opentine v0.7 can act as both a sink and a source for OpenTelemetry GenAI provenance. Import normalizes supported OpenTelemetry content into the sameTraceEvent model as native recording. Export renders a loaded run as GenAI spans or a complete OTLP/JSON document.

Export a portable run

export_otel.py
1import json
2from pathlib import Path
3
4from opentine import Run, to_otel_genai, to_otel_genai_document
5
6run = Run.load("run.tine")
7spans = to_otel_genai(run)
8document = to_otel_genai_document(run, service_name="research-agent")
9
10Path("run.otlp.json").write_text(json.dumps(document), encoding="utf-8")

to_otel_genai() returns a list of span dictionaries.to_otel_genai_document() returns a Python dictionary containing a complete OTLP/JSON export document. Both functions are read-only: they do not write a file, open a network connection, or transmit data to a backend.

Terminal
# Write a complete OTLP/JSON document
tine export run.tine --output run.otlp.json

# Send it to a literal loopback OTLP/HTTP endpoint
tine export run.tine --endpoint http://127.0.0.1:4318

tine export writes the same document to standard output or a file, or posts it to an OTLP/HTTP endpoint. Cleartext HTTP is refused unless the host is a literal loopback address or the operator passes--allow-insecure explicitly.

Export a repository run

export_repo.py
1from opentine import Repo, to_otel_genai_document
2
3repo = Repo.open(".")
4run = repo.load_run("heads/main")
5document = to_otel_genai_document(run, service_name="agent")

The same API accepts a v2 Run, a loaded portable artifact, a v3 repository run, one TraceEvent, or an iterable of events. Pass the returned document to the exporter or transport your observability stack expects.

Import from the shell

Terminal
# Complete OTLP/JSON document
tine import run.otlp.json --format otel-json --save run.tine

# A JSON array or JSONL stream of GenAI spans
tine import spans.jsonl --format otel-spans --repo . --ref heads/imported

otel-json accepts complete OTLP/JSON, a spans wrapper, or one span object. otel-spans accepts a JSON array or one span per line. See tine import for destination and overwrite rules.

Modern GenAI message content

The importer and exporter understand classic OpenTelemetry semconv 1.27gen_ai.prompt and gen_ai.completion, plus semconv 1.36 structured gen_ai.input.messages andgen_ai.output.messages, their JSON-string attribute forms, message and choice span events, and flattened OpenLLMetry and OpenInference shapes. v0.7 exports a schema URL, complete usage dimensions, and an appropriate span kind for each event. When classic prompt or completion attributes are present, they take precedence.

Round-trip boundary

Export and import preserve the GenAI fields the importer understands, including trace, span, parent identity, model, content, and normalized usage. Do not treat the operation as a byte-for-byte archive conversion: timestamps are represented through floating-point seconds, null attributes are omitted, and cost and billing travel in opentine.* attributes that the importer does not restore into their dedicated TraceEvent fields.

Exported spans can contain recorded prompts, completions, and tool content. Inspect the document before sending it outside your trust boundary. The open v0.7.1 hardening work includes audited fixes for depth truncation, mixed telemetry shapes, and causal-link round trips; those fixes are not part of the published 0.7.0 wheel.