mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-10 09:50:58 +02:00
Clarify HTTP/gRPC exporter examples (#3492)
Signed-off-by: Yuri Shkuro <github@ysh.us>
This commit is contained in:
parent
d7b31155b5
commit
aa868d506b
@ -57,10 +57,14 @@ func initProvider() (func(context.Context) error, error) {
|
||||
// microk8s), it should be accessible through the NodePort service at the
|
||||
// `localhost:30080` endpoint. Otherwise, replace `localhost` with the
|
||||
// endpoint of your cluster. If you run the app inside k8s, then you can
|
||||
// probably connect directly to the service through dns
|
||||
// probably connect directly to the service through dns.
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, "localhost:30080", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
|
||||
conn, err := grpc.DialContext(ctx, "localhost:30080",
|
||||
// Note the use of insecure transport here. TLS is recommended in production.
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithBlock(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create gRPC connection to collector: %w", err)
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace
|
||||
|
||||
## Examples
|
||||
|
||||
- [Exporter setup and examples](./otlptracehttp/example_test.go)
|
||||
- [Full example sending telemetry to a local collector](../../../example/otel-collector)
|
||||
- [HTTP Exporter setup and examples](./otlptracehttp/example_test.go)
|
||||
- [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector)
|
||||
|
||||
## [`otlptrace`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user