A pure Pony OpenTelemetry client that exports spans to any OTLP-compatible collector over HTTP/JSON.
otel.pony provides a fluent span builder, a batching tracer actor, and spec-compliant OTLP JSON serialization. It includes an HTTP exporter built on courier, GenAI semantic conventions for LLM tracing (tokens, models, costs), and W3C Trace Context (traceparent) generation for distributed tracing.
Pony's actor model makes concurrent tracing natural, but the ecosystem lacks an OpenTelemetry client. otel.pony fills that gap with zero-copy attribute serialization, automatic batch flushing, and a NoopExporter for testing — so you get observability without fighting the type system.
Built for Pony developers who want to ship traces to Grafana, Jaeger, or any OTLP collector without leaving the language. If you're building actor-based services in Pony and need production observability, this is the library.
Add to your corral.json:
{
"locator": "github.com/TrogonStack/otel.pony.git",
"version": "0.1.0"
}Then:
corral fetchuse "otel"
actor Main
new create(env: Env) =>
// Create an exporter (or NoopExporter for testing)
let exporter = OtlpHttpExporter(env.root, "127.0.0.1", "4318")
// Create a tracer
let tracer = Tracer(exporter, "my-service", "1.0.0")
// Build and record a span
let rand = Rand(Time.nanos(), Time.nanos())
let ctx = SpanContext(OtelId.trace_id(rand), OtelId.span_id(rand))
let span = SpanBuilder("my.operation", ctx)
.>set_kind(SpanClient)
.>attr("key", "value")
.>attr_int("count", 42)
.>set_status(SpanStatus.ok())
.finish()
tracer.record(span)corral fetch
corral run -- ponyc otel/test -o build -b otel-test -Dopenssl_3.0.x
./build/otel-test57 tests (unit + property-based).
MIT