File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,19 @@ trino.RegisterCustomClient("foobar", foobarClient)
209
209
db , err := sql.Open (" trino" , " https://user@localhost:8080?custom_client=foobar" )
210
210
```
211
211
212
+ A custom client can also be used to add OpenTelemetry instrumentation. The
213
+ [ otelhttp] ( https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp )
214
+ package provides a transport wrapper that creates spans for HTTP requests and
215
+ propagates the trace ID in HTTP headers:
216
+
217
+ ``` go
218
+ otelClient := &http.Client {
219
+ Transport : otelhttp.NewTransport (http.DefaultTransport ),
220
+ }
221
+ trino.RegisterCustomClient (" otel" , otelClient)
222
+ db , err := sql.Open (" trino" , " https://user@localhost:8080?custom_client=otel" )
223
+ ```
224
+
212
225
#### Examples
213
226
214
227
```
You can’t perform that action at this time.
0 commit comments