pub enum EndpointLabel {
Exact,
MatchedPath,
MatchedPathWithFallbackFn(for<'f> fn(&'f str) -> String),
}Expand description
Determines how endpoints are reported.
Variants§
Exact
The reported endpoint label is always the fully qualified uri path that has been requested.
MatchedPath
The reported endpoint label is determined by first trying to extract and return axum::extract::MatchedPath,
and if that fails (typically on nested routes) it falls back to EndpointLabel::Exact behavior. This is
the default option.
MatchedPathWithFallbackFn(for<'f> fn(&'f str) -> String)
Same as EndpointLabel::MatchedPath, but instead of falling back to the exact uri called, it’s given to a user-defined
fallback function, that is expected to produce a String, which is then reported to Prometheus.
Trait Implementations§
Source§impl Clone for EndpointLabel
impl Clone for EndpointLabel
Source§fn clone(&self) -> EndpointLabel
fn clone(&self) -> EndpointLabel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for EndpointLabel
impl Default for EndpointLabel
Source§fn default() -> EndpointLabel
fn default() -> EndpointLabel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EndpointLabel
impl RefUnwindSafe for EndpointLabel
impl Send for EndpointLabel
impl Sync for EndpointLabel
impl Unpin for EndpointLabel
impl UnwindSafe for EndpointLabel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more