Open grantr opened 7 years ago
do you need a KV logging facility, or event+payload is enough? You could use LogData for now.
LogRecords would make sense, but will require major version bump.
Here's the current code:
span.LogFields(
otlog.String(eventKey, "Payload out"),
otlog.Int(gRPCResponseLengthTagName, event.Length),
otlog.Int(gRPCResponseWireLengthTagName, event.WireLength),
)
Would LogData work for that? I'm not sure if it supports multiple fields.
Why major version bump to add a new method? Is it a backward incompatible change?
No logdata won't work with fields.
Yes, adding a method to an interface is a breaking change - all existing implementations no longer implement the new interface. I guess depends on how you define "breaking", but say Jaeger tracer depends on ^1, so it will automatically break if we release 1.x with this change.
Oh right, I remember that now about Go interfaces. Bummer!
I'm using opentracing-go with the gRPC stats API, which emits lifecycle events as RPCs progress. Those events include their own timestamps, so I'd like to use them for logging.
I can use
LogRecord
to manipulate timestamps, but the only way to add them to a span seems to beFinishWithOptions
. I'd like to add them at any time during the life of a span. I think aLogRecords(records... LogRecord)
method on theSpan
interface would solve this.