(ctx context.Context, res *resource.Resource, endpoint string, secure bool)
| 90 | } |
| 91 | |
| 92 | func createTraceProvider(ctx context.Context, res *resource.Resource, endpoint string, secure bool) *sdktrace.TracerProvider { |
| 93 | expOpts := []otlptracegrpc.Option{ |
| 94 | otlptracegrpc.WithEndpoint(endpoint), |
| 95 | } |
| 96 | if !secure { |
| 97 | expOpts = append(expOpts, otlptracegrpc.WithInsecure()) |
| 98 | } |
| 99 | |
| 100 | exp, err := otlptracegrpc.New(ctx, expOpts...) |
| 101 | if err != nil { |
| 102 | otel.Handle(err) |
| 103 | return nil |
| 104 | } |
| 105 | return sdktrace.NewTracerProvider(sdktrace.WithBatcher(exp), sdktrace.WithResource(res)) |
| 106 | } |
| 107 | |
| 108 | func newResource(ctx context.Context) *resource.Resource { |
| 109 | opts := []resource.Option{ |
no test coverage detected