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

add ipv4Tag type for peer.ipv4 to support add ipv4 string to the span #155

Merged
merged 2 commits into from
Aug 6, 2017

Conversation

NeoCN
Copy link
Contributor

@NeoCN NeoCN commented Jul 27, 2017

Fixes #154

ext/tags.go Outdated
PeerHostIPv4 = uint32TagName("peer.ipv4")

// PeerHostIPv4String records IP v4 host address of the peer as a .-separated tuple. E.g., "127.0.0.1"
PeerHostIPv4String = stringTagName("peer.ipv4")
Copy link
Member

Choose a reason for hiding this comment

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

don't know if it's worth it, but it occurred to me that instead of a separate const we could define a new dedicated type for ipv4 that would have both Set(uint32) and SetString(string) methods. This would keep it both backwards compatible and keep the single public constant name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PeerHostIPv4 = ipv4TagName("peer.ipv4")

type ipv4TagName string

func (tag ipv4TagName) Set(span opentracing.Span, value uint32) {
	span.SetTag(string(tag), value)
}

func (tag ipv4TagName) SetString(span opentracing.Span, value string) {
	span.SetTag(string(tag), value)
}

Just like this?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

…tString(string) methods, remove the separate const `PeerHostIPv4String`
@NeoCN NeoCN changed the title add PeerHostIPv4String for use peer.ipv4 as a string tag add ipv4Tag type for peer.ipv4 to support add ipv4 string to the span Jul 28, 2017
@NeoCN
Copy link
Contributor Author

NeoCN commented Aug 5, 2017

@yurishkuro just want to know when will this pr and #152 be merged in master? We need them! Thanks

@yurishkuro yurishkuro merged commit 8ebe5d4 into opentracing:master Aug 6, 2017
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.

2 participants