Describe the current state
The logs and trace SDK exporters have a "GenericWriterExporter" generic struct that is used to build comptime types for creating StdOut and InMemory exporters.
|
|
|
/// GenericWriterExporter is the generic SpanExporter that outputs spans to the given writer. |
|
fn GenericWriterExporter( |
|
comptime Writer: type, |
|
) type { |
Describe the desired state
It would be nice if we could adapt this struct to accept a *std.Io.Writer parameter directly instead of relying on runtime checks on the generic field. If we can't, we can even remove the struct and use std.Io in the exporters directly.
I think we do it already differently for the metrics SDK, since we don't rely on the generic type anymore and both Stdout and InMemory exporters have their own implementation.
Goals:
Describe the current state
The logs and trace SDK exporters have a "GenericWriterExporter" generic struct that is used to build comptime types for creating StdOut and InMemory exporters.
opentelemetry-zig/src/sdk/trace/exporters/generic.zig
Lines 36 to 40 in b075448
Describe the desired state
It would be nice if we could adapt this struct to accept a
*std.Io.Writerparameter directly instead of relying on runtime checks on the generic field. If we can't, we can even remove the struct and use std.Io in the exporters directly.I think we do it already differently for the metrics SDK, since we don't rely on the generic type anymore and both Stdout and InMemory exporters have their own implementation.
Goals: