Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Is it possible to log with a timestamp without finishing a span? #156

Open
grantr opened this issue Aug 3, 2017 · 4 comments
Open

Is it possible to log with a timestamp without finishing a span? #156

grantr opened this issue Aug 3, 2017 · 4 comments

Comments

@grantr
Copy link

grantr commented Aug 3, 2017

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 be FinishWithOptions. I'd like to add them at any time during the life of a span. I think a LogRecords(records... LogRecord) method on the Span interface would solve this.

@yurishkuro
Copy link
Member

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.

@grantr
Copy link
Author

grantr commented Aug 3, 2017

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?

@yurishkuro
Copy link
Member

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.

@grantr
Copy link
Author

grantr commented Aug 4, 2017

Oh right, I remember that now about Go interfaces. Bummer!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants