-
Notifications
You must be signed in to change notification settings - Fork 2.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
Bump opentelemetry-collector to v0.14.0 #2617
Conversation
Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
1273fc6
to
64633e1
Compare
cmd/opentelemetry/app/exporter/elasticsearchexporter/esmodeltranslator/modeltranslator_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
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.
LGTM
@@ -91,17 +91,17 @@ func (f Factory) CreateDefaultConfig() configmodels.Exporter { | |||
|
|||
// CreateTraceExporter creates Jaeger Cassandra trace exporter. | |||
// This function implements OTEL component.ExporterFactory interface. | |||
func (f Factory) CreateTraceExporter( | |||
func (f Factory) CreateTracesExporter( |
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.
hehe, what happens when so many people contributing are not native speakers. "trace exporter" was grammatically correct name.
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.
not a jab at you, @Vemmy124 , but on the upstream change
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.
I confess it did sound strange to my ears, but I'm not a native speaker myself, so, thought it was a problem with my ears :-)
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.
I believe that was bogdandrutu's idea open-telemetry/opentelemetry-collector#1974
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.
And maybe it's really the problem of me being not native speaker, but I agree with him, because the component consumes the structure named pdata.Traces
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.
It doesn't matter what exact data type is passed, a component that exports traces (plural) is "trace exporter" (noun used as adjective in singular form).
if err != nil { | ||
return "", err | ||
} | ||
spanIDInt := tracetranslator.BytesToUInt64SpanID(spanID.Bytes()) | ||
if spanIDInt == 0 { | ||
return "", errZeroSpanID | ||
} | ||
return dbmodel.SpanID(fmt.Sprintf("%016x", spanIDInt)), nil |
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.
This probably would be more efficient:
import "encoding/hex"
src := spanID.Bytes()
dst := make([]byte, hex.EncodedLen(len(src)))
hex.Encode(dst, src)
return dbmodel.SpanID(dst)
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.
According to benchmark run on my device, this change gave 70ns vs previous 170ns
if err != nil { | ||
return "", err | ||
} | ||
spanIDInt := tracetranslator.BytesToUInt64SpanID(spanID.Bytes()) | ||
if spanIDInt == 0 { | ||
return "", errZeroSpanID |
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.
This feels misplaced to me. This kind of validation should've been done way earlier in the pipeline. The ES backend itself doesn't actually care if IDs are all zeroes, it would still work.
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.
You're definitely right, but practically having this error handled here can prevent some time of unnecessary debugging in case of zero IDs and missing validation earlier. I believe this error arises systematically, so anyway there will be collisions by ID and this will only implicitly indicate zero ID error.
{ | ||
traceID: pdata.NewTraceID([]byte("invalid-%")), | ||
err: "TraceID does not have 16 bytes", | ||
}, |
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.
not sure why these tests are removed - give the current code there would still be some kind of error returned from converters.
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.
But TraceID is now exactly [16]byte
. Why would the error be there even if only several first bytes are set?
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.
They are silently truncated according to this PR conversations open-telemetry/opentelemetry-collector#2001
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.
lgtm, but why are some tests removed?
Seems like a problem with build. Could you take a look please, since you're acquainted with how tests are run? |
|
I don't understand, how this piece of code passed lint before then. Anyways, let's add comments |
Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
Pull request has been modified.
6dc93bc
to
f6a0e29
Compare
I wasn't right about the tests correction, fixed now. What is the reason of absence of golangci.yml in the main repo? Wouldn't it be useful for local checks? |
Codecov Report
@@ Coverage Diff @@
## master #2617 +/- ##
==========================================
- Coverage 95.07% 95.04% -0.04%
==========================================
Files 209 209
Lines 9364 9364
==========================================
- Hits 8903 8900 -3
- Misses 385 387 +2
- Partials 76 77 +1
Continue to review full report at Codecov.
|
@yurishkuro @jpkrohling Can we merge now? |
There's one pending change requested by Yuri: #2617 (comment) About the linting configuration: I think it would be a welcome change. |
Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
c87a78b
to
a78e918
Compare
@yurishkuro was right - new method for span ID conversion is a lot faster. Now I believe everything is resolved (well, idk if we reached consensus about spanID validation) |
Restarted build. I have not seen crossdock test failing too often recently, and here it failed several times, may be related to this change. But could be flaky too, let's see how the build comes back. |
FWIW in my build on real data some traces are lost somewhere between elasticexporter and elastic cluster. The worst thing is that there are no logs about loss in opentelemetry-collector component until v0.14.0. This might be closely related actually and I will investigate that once we merge this PR. Defending my changes in commits, I have to notice, that tests passed with my previous commit, which (at least should) have equivalent semantics with the latest version. |
Pretty sure the crossdock_otel CI failure is related to this change - it consistently failed 3 times, while passing on master and other PRs. |
Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
Pull request has been modified.
Found the problem. There was no test on the case when only 8 bytes of trace id is generated. Corrected tests to check that as well |
Thanks! Go phystech.edu :-) |
* bump opentelemetry-collector to v0.14.0 Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * initialize traceid and spanid explicitly Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fix comments and empty parent span check Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fasten convert traceID/spanID Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fix convertTraceID + fix tests Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu>
* Bump opentelemetry-collector to v0.14.0 (jaegertracing#2617) * bump opentelemetry-collector to v0.14.0 Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * initialize traceid and spanid explicitly Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fix comments and empty parent span check Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fasten convert traceID/spanID Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * fix convertTraceID + fix tests Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * Update CodeQL to latest best practices (jaegertracing#2615) This will parallelize your analysis and speed things up a bunch. Signed-off-by: jhutchings1 <jhutchings1@users.noreply.github.com> Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de> * Fix flaky TestReload (jaegertracing#2624) Signed-off-by: albertteoh <albert.teoh@logz.io> * Update x/text to v0.3.4 (jaegertracing#2625) Signed-off-by: Gary Brown <gary@brownuk.com> * Bump to latest UI for snapshot builds (jaegertracing#2626) Signed-off-by: Yuri Shkuro <github@ysh.us> * Implement anonymizer's main program (jaegertracing#2621) * Preparing release 1.21.0 (jaegertracing#2630) * updated changelog Signed-off-by: Joe Elliott <number101010@gmail.com> * Added ui changelog Signed-off-by: Joe Elliott <number101010@gmail.com> * Fixed UI changelog to point to 1.12.0 Signed-off-by: Joe Elliott <number101010@gmail.com> * Updated jaeger-ui to v1.12.0 Signed-off-by: Joe Elliott <number101010@gmail.com> * Resolving concerns Signed-off-by: Joe Elliott <number101010@gmail.com> * [anonymizer] Save trace in UI format (jaegertracing#2629) * Use fossa-contrib/fossa-action instead (jaegertracing#2571) * Use fossa-contrib/fossa-action instead Signed-off-by: Sora Morimoto <sora@morimoto.io> * Make step name clearer Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> * Update Makefile and Dockerfile for anonymizer (jaegertracing#2632) Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com> * Fix listen IP in unit test (jaegertracing#2636) Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com> * Bump opentelemetry to v0.15.0 (jaegertracing#2634) * Bump opentelemetry to v0.15.0 Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * add default value instead of nil value for jaegerreceiver config Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> * make lint Signed-off-by: Pavel Kositsyn <kositsyn.pa@phystech.edu> Co-authored-by: Kositsyn Pavel <vemmy124@gmail.com> Co-authored-by: Justin Hutchings <jhutchings1@users.noreply.github.com> Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de> Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com> Co-authored-by: Gary Brown <gary.pi4tech@gmail.com> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Co-authored-by: Ashmita <ashmita.bohara152@gmail.com> Co-authored-by: Joe Elliott <number101010@gmail.com> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: ZouYu <zouy.fnst@cn.fujitsu.com> Co-authored-by: Kositsyn Pavel <kositsyn.pa@phystech.edu>
Which problem is this PR solving?
Adds compatibility with new version of collector
Short description of the changes
Just refactoring mostly. There is only one open question: should retry queue be enabled by default?
Collector defaults are to enable it, but according to tests it should be disabled