Skip to content

Commit

Permalink
chore: update opentelemetry-go (#624)
Browse files Browse the repository at this point in the history
# Description

Updated the latest version of
[opentelemetry-go](https://github.com/open-telemetry/opentelemetry-go)
to use the [OTLP
HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp) exporter by
default.
  • Loading branch information
venjiang authored Oct 7, 2023
1 parent 49c81dd commit 23004e8
Show file tree
Hide file tree
Showing 26 changed files with 374 additions and 268 deletions.
2 changes: 1 addition & 1 deletion cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var serveCmd = &cobra.Command{
}
ctx := context.Background()
// trace
tp, shutdown, err := trace.NewTracerProviderWithJaeger("yomo-zipper")
tp, shutdown, err := trace.NewTracerProvider("yomo-zipper")
if err == nil {
log.InfoStatusEvent(os.Stdout, "[zipper] 🛰 trace enabled")
}
Expand Down
2 changes: 1 addition & 1 deletion cli/serverless/deno/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func runDeno(jsPath string, socketPath string, errCh chan<- error) {

func startSfn(name string, zipperAddr string, credential string, observed []frame.Tag, conn net.Conn, errCh chan<- error) (yomo.StreamFunction, error) {
// trace
tp, shutdown, err := trace.NewTracerProviderWithJaeger("yomo-sfn")
tp, shutdown, err := trace.NewTracerProvider("yomo-sfn")
if err == nil {
log.Println("[sfn] 🛰 trace enabled")
}
Expand Down
2 changes: 1 addition & 1 deletion cli/serverless/golang/templates/main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {

func runSFN(name string, addr string, credential string) (closeFn func() error, err error) {
// trace
tp, shutdown, e := trace.NewTracerProviderWithJaeger("yomo-sfn")
tp, shutdown, e := trace.NewTracerProvider("yomo-sfn")
if e == nil {
log.Println("[sfn] 🛰 trace enabled")
}
Expand Down
2 changes: 1 addition & 1 deletion cli/serverless/golang/templates/main_rx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {

func runSFN(name string, addr string, credential string) (closeFn func() error, err error) {
// trace
tp, shutdown, e := trace.NewTracerProviderWithJaeger("yomo-sfn")
tp, shutdown, e := trace.NewTracerProvider("yomo-sfn")
if e == nil {
log.Println("[sfn] 🛰 trace enabled")
}
Expand Down
2 changes: 1 addition & 1 deletion cli/serverless/wasm/serverless.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *wasmServerless) Build(clean bool) error {
// Run the wasm serverless function
func (s *wasmServerless) Run(verbose bool) error {
// trace
tp, shutdown, err := trace.NewTracerProviderWithJaeger("yomo-sfn")
tp, shutdown, err := trace.NewTracerProvider("yomo-sfn")
if err == nil {
pkglog.InfoStatusEvent(os.Stdout, "[sfn] 🛰 trace enabled")
}
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/api/sfn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Set the tracer provider for this Source instance.
- `tp`: The tracer provider.

```go
tp, shutdown, err := trace.NewTracerProviderWithJaeger("yomo-sfn")
tp, shutdown, err := trace.NewTracerProvider("yomo-sfn")
if err == nil {
log.Println("[sfn] 🛰 trace enabled")
}
Expand Down Expand Up @@ -205,4 +205,4 @@ PipeHandler is used to handle chunked stream data, like video stream, audio stre

[sfnOption]: #type-sfnoption
[zipper]: ../cli/zipper
[tag]: ./tag
[tag]: ./tag
2 changes: 1 addition & 1 deletion docs/pages/docs/api/source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Set the tracer provider for this Source instance.

```go
// trace
tp, shutdown, err := trace.NewTracerProviderWithJaeger("yomo-source")
tp, shutdown, err := trace.NewTracerProvider("yomo-source")
if err == nil {
log.Println("[source] 🛰 trace enabled")
}
Expand Down
8 changes: 5 additions & 3 deletions docs/pages/docs/opentracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Steps } from 'nextra-theme-docs'

# Guide: Tracing the Data Processing Streamline by Jaeger

YoMo support distributed tracing by [OpenTelemetry](https://opentelemetry.io), with first-class support for Jaeger by default (other supports can be changed by modifying the TracerProvider in the source code). To enable distributed tracing, follow the steps below:
YoMo support distributed tracing by [OpenTelemetry](https://opentelemetry.io), the default is [OTLP HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp) exporter.

<Steps>

Expand All @@ -19,15 +19,17 @@ Follow the [Jaeger Official Guide](https://www.jaegertracing.io/docs/getting-sta
#### StreamFunction Tracing

```bash
YOMO_TRACE_JAEGER_ENDPOINT=http://localhost:14268/api/traces yomo run sfn.wasm
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 yomo run sfn.wasm
```

#### Zipper Tracing

```bash
YOMO_TRACE_JAEGER_ENDPOINT=http://localhost:14268/api/traces yomo serve -c config.yaml
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 yomo serve -c config.yaml
```

See the [configuration options](https://opentelemetry.io/docs/specs/otel/protocol/exporter/#configuration-options) for more details.

### Dashboard

Open Jaeger UI in the browser (default is: http://localhost:16686), select services, click the list items to view the SFN trace, you will see the dashboard like this:
Expand Down
37 changes: 23 additions & 14 deletions example/1-pipeline/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,39 @@ require github.com/yomorun/yomo v0.0.0

require (
github.com/caarlos0/env/v6 v6.10.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/matoous/go-nanoid/v2 v2.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
github.com/onsi/ginkgo/v2 v2.12.1 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/quic-go/quic-go v0.38.1 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yomorun/y3 v1.0.5 // indirect
go.opentelemetry.io/otel v1.17.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
go.opentelemetry.io/otel/metric v1.17.0 // indirect
go.opentelemetry.io/otel/sdk v1.17.0 // indirect
go.opentelemetry.io/otel/trace v1.17.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
go.opentelemetry.io/otel v1.18.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.18.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.18.0 // indirect
go.opentelemetry.io/otel/metric v1.18.0 // indirect
go.opentelemetry.io/otel/sdk v1.18.0 // indirect
go.opentelemetry.io/otel/trace v1.18.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 23004e8

Please sign in to comment.