Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/go/interceptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
))
```

Expand Down
14 changes: 9 additions & 5 deletions docs/go/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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),
)
}
```
Expand Down
4 changes: 4 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ code {
vertical-align: baseline;
}

pre {
tab-size: 2;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now, the examples are a little too indented with the default of 8 spaces for tab-size:

Image

}

@media (min-width: 997px) {
.mobile-only {
display: none;
Expand Down
Loading