Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to the OpenTracing key-value logging change #25

Closed
wants to merge 1 commit into from

Conversation

bhs
Copy link
Contributor

@bhs bhs commented Sep 19, 2016

This builds against opentracing/opentracing-go#108. @basvanbeek this is not "Done" done but should be a good start. I'll add a few questions inline.

@@ -19,7 +19,12 @@ type EventBaggage struct {
Key, Value string
}

// EventLogFields is received when LogFields or LogKV is called.
type EventLogFields opentracing.LogRecord
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I mirrored changes to basictracer-go here and elsewhere)

@@ -116,7 +142,7 @@ func (s *spanImpl) Log(ld opentracing.LogData) {
ld.Timestamp = time.Now()
}

s.raw.Logs = append(s.raw.Logs, ld)
s.raw.Logs = append(s.raw.Logs, ld.ToLogRecord())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use a helper to convert old stuff to new stuff.

@@ -107,8 +107,9 @@ func TestSpan_SingleLoggedTaggedSpan(t *testing.T) {
assert.Equal(t, 1, len(spans))
assert.Equal(t, "x", spans[0].Operation)
assert.Equal(t, 1, len(spans[0].Logs))
assert.Equal(t, "event", spans[0].Logs[0].Event)
assert.Equal(t, "payload", spans[0].Logs[0].Payload)
// XXX: broken tests
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to fix these until we decided what to do about the annotations more generally.

spLog.Timestamp = time.Now()
}
annotate(span, spLog.Timestamp, spLog.Event, r.endpoint)
// XXX: decide how to represent spLog.Fields as an annotation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@basvanbeek @adriancole this is the only interesting bit... how much / how little of the key:value data do you want to represent as timestamped zipkin Span annotations? If you tell me what you'd like this to be, I'm happy to write up an Encoder impl, it'll just take a few minutes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh probably not the best one to comment, as I've never been a fan of this feature. it is a complex datastructure (map) with a timestamp. IMHO, this sort of thing is a front-end rendering or layout problem, in the same space as things like log4j, unless we are defining this as a backend/wire format concern.

Before I speculate how this might be used in zipkin, it is probably best to have the champion of this feature comment. @yurishkuro are you planning to make an encoder on the frontend? or are you developing a non-zipkin backend data structure to replace zipkin? or do you have other plans wrt this thing?

Until then, here's a hint.. Let's assume we didn't assume responsibilities like normal loggers have with regards to formatting, and we just did json encoding.. ex {"event": "soft error", "type": "cache timeout", "waited.millis": 1500}

With no changes to the existing UI or data format, it ends up looking like this (the mis-rendering is probably a bug):
screen shot 2016-09-20 at 9 58 07 am

And here's it in the up-and-coming UI by @rogeralsing
screen shot 2016-09-20 at 9 58 26 am

@@ -91,6 +92,31 @@ func (s *spanImpl) SetTag(key string, value interface{}) opentracing.Span {
return s
}

func (s *spanImpl) LogKV(keyValues ...interface{}) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to be clear... KV is a required part of the api now?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this dates back to opentracing/opentracing.io#96 .

The use cases haven't been well-centralized, but I feel good about having a timestamped KV at the bottom.

spLog.Timestamp = time.Now()
}
annotate(span, spLog.Timestamp, spLog.Event, r.endpoint)
// XXX: decide how to represent spLog.Fields as an annotation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh probably not the best one to comment, as I've never been a fan of this feature. it is a complex datastructure (map) with a timestamp. IMHO, this sort of thing is a front-end rendering or layout problem, in the same space as things like log4j, unless we are defining this as a backend/wire format concern.

Before I speculate how this might be used in zipkin, it is probably best to have the champion of this feature comment. @yurishkuro are you planning to make an encoder on the frontend? or are you developing a non-zipkin backend data structure to replace zipkin? or do you have other plans wrt this thing?

Until then, here's a hint.. Let's assume we didn't assume responsibilities like normal loggers have with regards to formatting, and we just did json encoding.. ex {"event": "soft error", "type": "cache timeout", "waited.millis": 1500}

With no changes to the existing UI or data format, it ends up looking like this (the mis-rendering is probably a bug):
screen shot 2016-09-20 at 9 58 07 am

And here's it in the up-and-coming UI by @rogeralsing
screen shot 2016-09-20 at 9 58 26 am

@yurishkuro
Copy link

@adriancole until better times, we're going with JSON encoding (see PR), unless the only field is event

@codefromthecrypt
Copy link

@adriancole https://github.com/adriancole until better times, we're
going with JSON encoding (see PR)
https://github.com/uber/jaeger-client-go/pull/42/files#diff-0c86eb97f3a2f8a9893cb60c27e21dd7R33,
unless the only field is event

OK then that sounds easiest. I'll fix the json rendering bug in the
existing UI. We can open a story in zipkin-ui for how to better render json
annotations.

@codefromthecrypt
Copy link

here's the story in the new zipkin UI
openzipkin-attic/zipkin-ui#11

On Tue, Sep 20, 2016 at 10:36 AM, Adrian Cole adrian.f.cole@gmail.com wrote:

@adriancole until better times, we're going with JSON encoding (see PR),
unless the only field is event

OK then that sounds easiest. I'll fix the json rendering bug in the existing
UI. We can open a story in zipkin-ui for how to better render json
annotations.

@bhs
Copy link
Contributor Author

bhs commented Sep 23, 2016

@basvanbeek thoughts?

@basvanbeek
Copy link
Member

Sorry for the late response, I will take a look this weekend.

@bhs
Copy link
Contributor Author

bhs commented Sep 26, 2016

@basvanbeek admittedly, the real problem here is that Go doesn't have a good story on semver... that said, I would like to merge opentracing/opentracing-go#108 and it will break this package unless something like this PR 25 is merged.

Are you ok with me merging the OT-Go change? If not, any guidance about when you can get to the remaining details in this PR? Let me know, thanks...

@bhs
Copy link
Contributor Author

bhs commented Sep 26, 2016

superseded by #26 ... closing!

@bhs bhs closed this Sep 26, 2016
@bhs bhs deleted the bhs/log_kv branch September 26, 2016 22:22
basvanbeek added a commit that referenced this pull request Sep 26, 2016
Handle OpenTracing key-value logging, finished work in PR #25
richardmarshall pushed a commit to richardmarshall/zipkin-go-opentracing that referenced this pull request Dec 13, 2016
…_hdr_report

adds a summary latency report and a latency CSV file output option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants