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: lib.rs
    path of file: ./repos/ckb/util/metrics-service/src
    
    the code of the file until where you have to start completion: //! The service which handles the metrics data in CKB.

use std::{convert::Infallible, net::SocketAddr};

use hyper::{
    header::CONTENT_TYPE,
    service::{make_service_fn, service_fn},
    Body, Error as HyperError, Method, Request, Response, Server,
};
use prometheus::Encoder as _;

use ckb_async_runtime::Handle;
use ckb_logger::info;
use ckb_metrics_config::{Config, Exporter, Target};
use ckb_stop_handler::{new_tokio_exit_rx, CancellationToken};
use ckb_util::strings;

/// Ensures the m
    
fn run_exporter(exporter: Exporter, handle: &Handle) -> Result<(), String> {
    let Exporter { target } = exporter;
    match target {
        Target::Prometheus { listen_address } => {
            let addr = listen_address
                .parse::<SocketAddr>()
                .map_err(|err| format!("failed to parse listen_address because {err}"))?;
            let make_svc = make_service_fn(move |_conn| async move {
                Ok::<_, Infallible>(service_fn(start_prometheus_service))
            });
            ckb_logger::info!("Start prometheus exporter at {}", addr);
            handle.spawn(async move {
                let server = Server::bind(&addr)
                    .serve(make_svc)
                    .with_graceful_shutdown(async {
                        let exit_rx: CancellationToken = new_tokio_exit_rx();
                        exit_rx.cancelled().await;
                        info!("Prometheus server received exit signal; exit now");
                    });
                if let Err(err) = server.await {
                    ckb_logger::error!("prometheus server error: {}", err);
                }
            });
        }
    }
    Ok(())
}