@@ -26,7 +26,6 @@ type config struct {
2626 Meter metric.Meter
2727 Propagators propagation.TextMapPropagator
2828 SpanStartOptions []trace.SpanStartOption
29- PublicEndpoint bool
3029 PublicEndpointFn func (* http.Request ) bool
3130 ReadEvent bool
3231 WriteEvent bool
@@ -96,17 +95,19 @@ func WithMeterProvider(provider metric.MeterProvider) Option {
9695// WithPublicEndpoint configures the Handler to link the span with an incoming
9796// span context. If this option is not provided, then the association is a child
9897// association instead of a link.
98+ //
99+ // Deprecated: Use [WithPublicEndpointFn] instead.
100+ // To migrate, replace WithPublicEndpoint() with:
101+ //
102+ // WithPublicEndpointFn(func(*http.Request) bool { return true })
99103func WithPublicEndpoint () Option {
100- return optionFunc (func (c * config ) {
101- c .PublicEndpoint = true
102- })
104+ return WithPublicEndpointFn (func (* http.Request ) bool { return true })
103105}
104106
105107// WithPublicEndpointFn runs with every request, and allows conditionally
106108// configuring the Handler to link the span with an incoming span context. If
107109// this option is not provided or returns false, then the association is a
108110// child association instead of a link.
109- // Note: WithPublicEndpoint takes precedence over WithPublicEndpointFn.
110111func WithPublicEndpointFn (fn func (* http.Request ) bool ) Option {
111112 return optionFunc (func (c * config ) {
112113 c .PublicEndpointFn = fn
0 commit comments