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

Adds ext/tags mechanism for adding common tags to the span #19

Merged
merged 4 commits into from
Dec 29, 2015

Conversation

yurishkuro
Copy link
Member

@@ -1,4 +1,4 @@
package main
package dapperish
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to rename the package to be able to import it into tests, since we don't have any other working implementation of the trace context source.

@@ -37,7 +37,7 @@ func (s *standardSpan) StartChild(operationName string) opentracing.Span {
func (s *standardSpan) SetTag(key string, value interface{}) opentracing.Span {
s.lock.Lock()
defer s.lock.Unlock()
s.raw.Tags[key] = fmt.Sprint(value)
s.raw.Tags[key] = value
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed conversion to string, as it was making the new tests fail. I think conversion should be done by the Recorder, if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

That seems better, agreed.

@@ -78,7 +79,7 @@ func server() {
}

func main() {
opentracing.InitDefaultTracer(NewTracer("dapperish_tester"))
opentracing.InitDefaultTracer(dapperish.NewTracer("dapperish_tester"))
Copy link
Member Author

Choose a reason for hiding this comment

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

moved one level up to keep it in main package, while the actual dapperish implementation is in dapperish subpackage

@yurishkuro yurishkuro mentioned this pull request Dec 28, 2015
import (
"testing"

"github.com/opentracing/api-golang/examples/dapperish"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should rename examples to testing... seems weird to have anything under api-golang/opentracing/ depending on anything under api-golang/examples/, even if it's just a test.

Copy link
Member Author

Choose a reason for hiding this comment

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

really it was just me cheating. I've already added testutils package, and for this test I only need minimal set of functionality from the Source implementation, so we could just copy a DaperishTraceContextSource under test utils

Copy link
Contributor

Choose a reason for hiding this comment

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

that seems right.

@bhs
Copy link
Contributor

bhs commented Dec 28, 2015

LGTM with the caveat that all of this stuff will probably have to change as we move forward with proper bindings, etc. Thanks!

@bhs
Copy link
Contributor

bhs commented Dec 28, 2015

Oh, per #12: can you update the Span.SetTag comment?

yurishkuro added a commit that referenced this pull request Dec 29, 2015
Adds ext/tags mechanism for adding common tags to the span
@yurishkuro yurishkuro merged commit 82bcc14 into master Dec 29, 2015
@slimsag slimsag deleted the ext-tags branch December 29, 2015 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants