-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: separate the logic of distributed tracing (#736)
# Description Omit the `WithTracerProvider()` options as manual injection of the tracer provider in the code is unnecessary. The tracing functionality will be activated upon setting the 'OTEL_EXPORTER_OTLP_ENDPOINT' environment variable. # Changes Before: ```golang // create trace provider manully tp, shutdown, e := trace.NewTracerProvider("yomo-sfn") if e == nil { log.Println("[sfn] 🛰 trace enabled") } defer shutdown(context.Background()) sfn := yomo.NewStreamFunction( name, addr, yomo.WithCredential(credential), yomo.WithTracerProvider(tp), // add trace provider to opts ) ``` After: ```golang sfn := yomo.NewStreamFunction( name, addr, yomo.WithCredential(credential), ) ``` run: ```sh OTEL_EXPORTER_OTLP_ENDPOINT=https://opentracing.acme.com:7234 yomo run sfn.go ``` # TODO update related docs.
- Loading branch information
Showing
29 changed files
with
254 additions
and
476 deletions.
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
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
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
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
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
Oops, something went wrong.