logo
pub struct OpenTelemetryMetricsMiddleware { /* private fields */ }
Expand description

The middleware struct to be used in tide

Implementations

Instantiate the middleware

Examples
let mut app = tide::new();
app.with(opentelemetry_tide::OpenTelemetryMetricsMiddleware::new(None));
app.at("/").get(|_| async { Ok("Metricized!") });
with custom metrics configuration
let mut app = tide::new();
let mut config = opentelemetry_tide::MetricsConfig::default();
config.global_tags = Some(vec![opentelemetry::KeyValue::new("K","V")];)
app.with(opentelemetry_tide::OpenTelemetryMetricsMiddleware::new(config));
app.at("/").get(|_| async { Ok("Metricized!") });

Trait Implementations

Formats the value using the given formatter. Read more

Instantiate the middleware with defaults

Examples
let mut app = tide::new();
app.with(opentelemetry_tide::OpenTelemetryMetricsMiddleware::default());
app.at("/").get(|_| async { Ok("Metricized!") });

Asynchronously handle the request, and return a response.

Set the middleware’s name. By default it uses the type signature.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more