package filters
import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/filters"
Package filters provides a set of filters useful with the otelhttp.WithFilter() option to control which inbound requests are traced.
Index ¶
- func All(fs ...otelhttp.Filter) otelhttp.Filter
- func Any(fs ...otelhttp.Filter) otelhttp.Filter
- func Header(k, v string) otelhttp.Filter
- func HeaderContains(k, v string) otelhttp.Filter
- func Hostname(h string) otelhttp.Filter
- func Method(m string) otelhttp.Filter
- func None(fs ...otelhttp.Filter) otelhttp.Filter
- func Not(f otelhttp.Filter) otelhttp.Filter
- func Path(p string) otelhttp.Filter
- func PathPrefix(p string) otelhttp.Filter
- func Query(k, v string) otelhttp.Filter
- func QueryContains(k, v string) otelhttp.Filter
Functions ¶
func All ¶
All takes a list of Filters and returns a Filter that returns true only if all Filters in the list return true.
func Any ¶
Any takes a list of Filters and returns a Filter that returns true if any Filter in the list returns true.
func Header ¶
Header returns a Filter that returns true if the request includes a header k with a value equal to v.
func HeaderContains ¶
HeaderContains returns a Filter that returns true if the request includes a header k with a value that contains v.
func Hostname ¶
Hostname returns a Filter that returns true if the request's hostname matches the provided string.
func Method ¶
Method returns a Filter that returns true if the request method is equal to the provided value.
func None ¶
None takes a list of Filters and returns a Filter that returns true only if none of the Filters in the list return true.
func Not ¶
Not provides a convenience mechanism for inverting a Filter.
func Path ¶
Path returns a Filter that returns true if the request's path matches the provided string.
func PathPrefix ¶
PathPrefix returns a Filter that returns true if the request's path starts with the provided string.
func Query ¶
Query returns a Filter that returns true if the request includes a query parameter k with a value equal to v.
func QueryContains ¶
QueryContains returns a Filter that returns true if the request includes a query parameter k with a value that contains v.
Source Files ¶
filters.go header.go
- Version
- v0.60.0 (latest)
- Published
- Mar 6, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 1 month ago –
Tools for package owners.