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

Replace Jaeger SDK with OTEL SDK + OT Bridge #4574

Merged
merged 37 commits into from
Jul 20, 2023

Conversation

afzal442
Copy link
Contributor

@afzal442 afzal442 commented Jul 7, 2023

Which problem is this PR solving?

Short description of the changes

  • Upgrades jaeger tracing to support otel tracer

afzal442 added 2 commits July 7, 2023 19:41
Signed-off-by: Afzal Ansari <[email protected]>
Signed-off-by: Afzal Ansari <[email protected]>
@afzal442 afzal442 requested a review from a team as a code owner July 7, 2023 19:46
@afzal442 afzal442 requested a review from vprithvi July 7, 2023 19:46
@afzal442 afzal442 changed the title Add otel tp jtracer [WIP] Add otel tp jtracer Jul 7, 2023
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
Signed-off-by: Afzal Ansari <[email protected]>
@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (587fb74) 97.03% compared to head (f905480) 97.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4574      +/-   ##
==========================================
+ Coverage   97.03%   97.07%   +0.03%     
==========================================
  Files         301      301              
  Lines       17839    17857      +18     
==========================================
+ Hits        17310    17334      +24     
+ Misses        424      419       -5     
+ Partials      105      104       -1     
Flag Coverage Δ
unittests 97.07% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/query/app/grpc_handler.go 98.78% <100.00%> (ø)
cmd/query/app/handler_options.go 100.00% <100.00%> (ø)
cmd/query/app/http_handler.go 100.00% <100.00%> (ø)
cmd/query/app/server.go 94.57% <100.00%> (ø)

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
plugin/metrics/prometheus/metricsstore/reader.go Outdated Show resolved Hide resolved
@afzal442 afzal442 changed the title [WIP] Add otel tp jtracer [WIP] feat: add otel tp to jtracer pkg Jul 11, 2023
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Outdated Show resolved Hide resolved
@afzal442 afzal442 force-pushed the add-otel-tp-jtracer branch from 1f8f7f2 to d429861 Compare July 13, 2023 15:21
Signed-off-by: Afzal Ansari <[email protected]>
cmd/all-in-one/main.go Outdated Show resolved Hide resolved
pkg/jtracer/testutils/.nocover Outdated Show resolved Hide resolved
cmd/query/app/grpc_handler.go Outdated Show resolved Hide resolved
cmd/query/app/grpc_handler_test.go Outdated Show resolved Hide resolved
cmd/query/app/http_handler.go Outdated Show resolved Hide resolved
cmd/query/app/http_handler_test.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
@yurishkuro yurishkuro changed the title [WIP] feat: add OTEL tracerProvider to jtracer pkg [WIP] Replace Jaeger SDK with OTEL SDK + OT Bridge Jul 20, 2023
afzal442 added 3 commits July 20, 2023 04:51
Signed-off-by: Afzal Ansari <[email protected]>
Signed-off-by: Afzal Ansari <[email protected]>
cmd/all-in-one/main.go Outdated Show resolved Hide resolved
cmd/all-in-one/main.go Outdated Show resolved Hide resolved
Signed-off-by: Afzal Ansari <[email protected]>
@afzal442 afzal442 requested a review from albertteoh July 20, 2023 10:31
tracerCloser := initTracer(svc)
tracer, err := jtracer.New("jaeger-all-in-one")
if err != nil {
logger.Fatal("Failed to initialize tracer", zap.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm... I wonder why we don't annotate and return the error here instead of logging it.

Copy link
Member

@yurishkuro yurishkuro Jul 20, 2023

Choose a reason for hiding this comment

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

I think mostly because if we return an error, it is intercepted at the top level of main like this:

	if err := command.Execute(); err != nil {
		log.Fatal(err)
	}

Here the zapp logger is not available so the stdlib log is used, which is formatted differently. E.g.:

$ go run ./cmd/all-in-one --admin.http.tls.enabled=true --admin.http.tls.key=invalid
. . .
2023/07/20 11:43:08 cannot initialize admin server: failed to watch key pair invalid and : open invalid: no such file or directory
exit status 1

With zapp logs you get line number and other nice things. E.g.

$ go run ./cmd/all-in-one --reporter.grpc.tls.enabled=true --reporter.grpc.tls.key=nopath
. . .
{"level":"fatal","ts":1689868046.063343,"caller":"all-in-one/main.go:192","msg":"Could not create collector proxy","error":"failed to load TLS config: failed to watch key pair nopath and : open nopath: no such file or directory","stacktrace":"main.main.func1\n\t/Users/ysh/dev/jaegertracing/jaeger/cmd/all-in-one/main.go:192\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/ysh/golang/pkg/mod/github.com/spf13/[email protected]/command.go:940\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/ysh/golang/pkg/mod/github.com/spf13/[email protected]/command.go:1068\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/ysh/golang/pkg/mod/github.com/spf13/[email protected]/command.go:992\nmain.main\n\t/Users/ysh/dev/jaegertracing/jaeger/cmd/all-in-one/main.go:243\nruntime.main\n\t/Users/ysh/homebrew/Cellar/go/1.20.5/libexec/src/runtime/proc.go:250"}
exit status 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's cool thing I noticed here. 🏷️

cmd/query/app/http_handler_test.go Outdated Show resolved Hide resolved
pkg/jtracer/jtracer.go Show resolved Hide resolved
pkg/jtracer/.nocover Show resolved Hide resolved
@albertteoh
Copy link
Contributor

Is it a good time to remove the [WIP] from the PR title?

afzal442 added 2 commits July 20, 2023 18:12
Signed-off-by: Afzal Ansari <[email protected]>
Signed-off-by: Afzal Ansari <[email protected]>
@yurishkuro yurishkuro changed the title [WIP] Replace Jaeger SDK with OTEL SDK + OT Bridge Replace Jaeger SDK with OTEL SDK + OT Bridge Jul 20, 2023
@yurishkuro yurishkuro merged commit 2c1bf07 into jaegertracing:main Jul 20, 2023
@afzal442 afzal442 deleted the add-otel-tp-jtracer branch July 21, 2023 04:46
@sbin64 sbin64 restored the add-otel-tp-jtracer branch August 14, 2023 07:10
@afzal442 afzal442 deleted the add-otel-tp-jtracer branch August 14, 2023 13:28
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