You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: metrics.rs
    path of file: ./repos/salvo/crates/otel/src
    
    the code of the file until where you have to start completion: use std::time::Instant;

use opentelemetry::metrics::{Counter, Histogram, Unit};
use opentelemetry::{global, KeyValue};
use opentelemetry_semantic_conventions::trace;
use salvo_core::http::ResBody;
use salvo_core::prelude::*;

/// Middleware for metrics with OpenTelemetry.
pub struct Metrics {
    request_count: Counter<
    
    async fn handle(&self, req: &mut Request, depot: &mut Depot, res: &mut Response, ctrl: &mut FlowCtrl) {
        let mut labels = Vec::with_capacity(3);
        labels.push(KeyValue::new(trace::HTTP_REQUEST_METHOD, req.method().to_string()));
        labels.push(KeyValue::new(trace::URL_FULL, req.uri().to_string()));

        let s = Instant::now();
        ctrl.call_next(req, depot, res).await;
        let elapsed = s.elapsed();

        let status = res.status_code.unwrap_or(StatusCode::NOT_FOUND);
        labels.push(KeyValue::new(trace::HTTP_RESPONSE_STATUS_CODE, status.as_u16() as i64));
        if status.is_client_error() || status.is_server_error() {
            self.error_count.add(1, &labels);
            let msg = if let ResBody::Error(body) = &res.body {
                body.to_string()
            } else {
                format!("ErrorCode: {}", status.as_u16())
            };
            labels.push(KeyValue::new(trace::EXCEPTION_MESSAGE, msg));
        }

        self.request_count.add(1, &labels);
        self.duration.record(elapsed.as_secs_f64() * 1000.0, &labels);
    }