-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix zipkinv2 translation error tag handling #2253
Merged
bogdandrutu
merged 7 commits into
open-telemetry:master
from
ericmustin:fix_zipkin_error_handling
Jan 4, 2021
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc95896
fix zipkinv2 translation error tag handling
ericmustin a288aea
use blank identifier for linting
ericmustin 52b30a7
[zipkin]: add check for 'true' string
ericmustin 0adaf7b
add error tag test
ericmustin 462e1c1
[zipkin] typo fix
ericmustin e48e7db
[zipkin]: fix tests to test error tag for zipkin
ericmustin 8a00493
Merge branch 'master' into fix_zipkin_error_handling
ericmustin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,12 @@ func TestZipkinSpansToInternalTraces(t *testing.T) { | |
td: generateTraceSingleSpanMinmalResource(), | ||
err: nil, | ||
}, | ||
{ | ||
name: "errorTag", | ||
zs: generateSpanErrorTag(), | ||
td: generateTraceSingleSpanErrorStatus(), | ||
err: nil, | ||
}, | ||
} | ||
for _, test := range tests { | ||
t.Run(test.name, func(t *testing.T) { | ||
|
@@ -101,6 +107,12 @@ func generateSpanNoTags() []*zipkinmodel.SpanModel { | |
return spans | ||
} | ||
|
||
func generateSpanErrorTag() []*zipkinmodel.SpanModel { | ||
spans := generateSpanNoEndpoints() | ||
spans[0].Tags = &zipkinmodel.Tags{error: "true"} | ||
return spans | ||
} | ||
|
||
func generateTraceSingleSpanNoResourceOrInstrLibrary() pdata.Traces { | ||
td := pdata.NewTraces() | ||
td.ResourceSpans().Resize(1) | ||
|
@@ -128,3 +140,16 @@ func generateTraceSingleSpanMinmalResource() pdata.Traces { | |
rsc.Attributes().UpsertString(conventions.AttributeServiceName, "SoleAttr") | ||
return td | ||
} | ||
|
||
func generateTraceSingleSpanErrorStatus() pdata.Traces { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a nit but perhaps |
||
td := pdata.NewTraces() | ||
td.ResourceSpans().Resize(1) | ||
rs := td.ResourceSpans().At(0) | ||
rs.InstrumentationLibrarySpans().Resize(1) | ||
ils := rs.InstrumentationLibrarySpans().At(0) | ||
ils.Spans().Resize(1) | ||
span := ils.Spans().At(0) | ||
span.Attributes().InitEmptyWithCapacity(0) | ||
span.Status().SetCode(pdata.StatusCodeError) | ||
return td | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the value matter?
true
orfalse
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, It looks like only lower case
true
is accepted, so i will updateref:
https://github.com/open-telemetry/opentelemetry-specification/pull/1257/files#diff-60d9dfa59a8a1a0776c260526b6148549d4087deb626d42732fdd7616ef7a636R56
https://github.com/open-telemetry/opentelemetry-specification/pull/1257/files#diff-c50b2cac17490acd52955c504c267e15e9b8f1bfd51f15e02369cb1c83071e13R130
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated