Skip to content

Commit

Permalink
Add HTTP post port mapping to docker command (#4407)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Resolves #4356

## Short description of the changes
- The HotRod example emits spans on jaeger-collector's HTTP endpoint.
- This exposes the port being listened to for spans over the HTTP
endpoint to fix an error in the HotRod example.
- A minor typo is also fixed.

Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
  • Loading branch information
albertteoh authored Apr 23, 2023
1 parent 6119406 commit 212b868
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/hotrod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ docker run \
--name jaeger \
-p6831:6831/udp \
-p16686:16686 \
-p14268:14268 \
jaegertracing/all-in-one:latest
```

Expand Down
3 changes: 1 addition & 2 deletions examples/hotrod/pkg/tracing/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ func Init(serviceName string, exporterType string, metricsFactory metrics.Factor
)),
)
otTracer, _ := otbridge.NewTracerPair(tp.Tracer(""))
logger.Bg().Debug("created OTEL->OT brige", zap.String("service-name", serviceName))
logger.Bg().Debug("created OTEL->OT bridge", zap.String("service-name", serviceName))
return otTracer
}

// withSecure instructs the client to use HTTPS scheme, instead of hotrod's desired default HTTP
func withSecure() bool {
return strings.HasPrefix(os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), "https://") ||
strings.ToLower(os.Getenv("OTEL_EXPORTER_OTLP_INSECURE")) == "false"

}

func createOtelExporter(exporterType string) (sdktrace.SpanExporter, error) {
Expand Down

0 comments on commit 212b868

Please sign in to comment.