From 04caa765396e2bc12f46ac3b955851317be1ddd7 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Tue, 21 Apr 2026 11:22:29 -0400 Subject: [PATCH 1/2] Make tab-size in codeblocks 2 spaces To limit the horizontal width in the Go examples. Signed-off-by: Stefan VanBuren --- src/css/custom.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/css/custom.css b/src/css/custom.css index 8f1435b..0399def 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -446,6 +446,10 @@ code { vertical-align: baseline; } +pre { + tab-size: 2; +} + @media (min-width: 997px) { .mobile-only { display: none; From f0288d9d652a1989cfb2b7bd4af669e86d833288 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Tue, 21 Apr 2026 11:22:57 -0400 Subject: [PATCH 2/2] Minor tweaks to Go examples * Drop validate interceptor in handler; now matches the client example * Drop ochttp reference (repository was archived 3 years ago) * Reformat newInterceptor to eliminate scrolling Signed-off-by: Stefan VanBuren --- docs/go/interceptors.md | 6 +----- docs/go/observability.md | 14 +++++++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/go/interceptors.md b/docs/go/interceptors.md index cdb5211..b6d4fca 100644 --- a/docs/go/interceptors.md +++ b/docs/go/interceptors.md @@ -81,14 +81,10 @@ To apply our new interceptor to handlers or clients, we can use ```go // For handlers: -interceptors := connect.WithInterceptors( - NewAuthInterceptor(), - validate.NewInterceptor(), -) mux := http.NewServeMux() mux.Handle(greetv1connect.NewGreetServiceHandler( &GreetServer{}, - interceptors, + connect.WithInterceptors(NewAuthInterceptor()), )) ``` diff --git a/docs/go/observability.md b/docs/go/observability.md index 0a63056..0cdccd4 100644 --- a/docs/go/observability.md +++ b/docs/go/observability.md @@ -3,7 +3,7 @@ title: Observability sidebar_position: 65 --- -Connect stays close to `net/http`, which means any logging, tracing, or metrics that work with an `http.Handler` or `http.Client` will also work with Connect. In particular, the [otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) OpenTelemetry package and the [ochttp](https://pkg.go.dev/go.opencensus.io/plugin/ochttp) OpenCensus package both integrate seamlessly with Connect servers and clients. +Connect stays close to `net/http`, which means any logging, tracing, or metrics that work with an `http.Handler` or `http.Client` will also work with Connect. In particular, the [otelhttp](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp) OpenTelemetry package integrates seamlessly with Connect servers and clients. For more detailed, RPC-focused metrics, use the [otelconnect] package. [otelconnect] works with your [OpenTelemetry] metrics and tracing setup to capture information such as: @@ -67,11 +67,15 @@ When running multiple applications in a single binary, or if different sections ```go // newInterceptor instruments Connect clients and handlers using custom OpenTelemetry metrics, tracing, and propagation. -func newInterceptor(tp trace.TracerProvider, mp metric.MeterProvider, p propagation.TextMapPropagator) (connect.Interceptor, error) { +func newInterceptor( + tracerProvider trace.TracerProvider, + metricProvider metric.MeterProvider, + textMapPropagator propagation.TextMapPropagator +) (connect.Interceptor, error) { return otelconnect.NewInterceptor( - otelconnect.WithTracerProvider(tp), - otelconnect.WithMeterProvider(mp), - otelconnect.WithPropagator(p), + otelconnect.WithTracerProvider(tracerProvider), + otelconnect.WithMeterProvider(metricProvider), + otelconnect.WithPropagator(textMapPropagator), ) } ```