fixed comments left by pan in #40
This commit is contained in:
parent
ff972fae48
commit
380afef80b
6
fly.toml
6
fly.toml
|
@ -26,6 +26,6 @@ kill_timeout = 5
|
||||||
soft_limit = 1024
|
soft_limit = 1024
|
||||||
type = "connections"
|
type = "connections"
|
||||||
|
|
||||||
# [metrics]
|
[metrics]
|
||||||
# path = "/metrics"
|
path = "/metrics"
|
||||||
# port = 9091
|
port = 9091
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
global:
|
|
||||||
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
|
||||||
|
|
||||||
scrape_configs:
|
|
||||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
|
||||||
- job_name: 'prometheus'
|
|
||||||
scrape_interval: 5s
|
|
||||||
static_configs:
|
|
||||||
- targets: ['localhost:9090']
|
|
||||||
|
|
||||||
- job_name: 'lite-rpc'
|
|
||||||
static_configs:
|
|
||||||
- targets: ['localhost:9500']
|
|
|
@ -28,7 +28,7 @@ impl PrometheusSync {
|
||||||
|
|
||||||
async fn handle_stream(&self, stream: &mut TcpStream) -> anyhow::Result<()> {
|
async fn handle_stream(&self, stream: &mut TcpStream) -> anyhow::Result<()> {
|
||||||
let metrics = self.metrics_capture.get_metrics().await;
|
let metrics = self.metrics_capture.get_metrics().await;
|
||||||
let metrics = serde_prometheus::to_string(&metrics, None, HashMap::new())?;
|
let metrics = serde_prometheus::to_string(&metrics, Some("literpc"), HashMap::new())?;
|
||||||
|
|
||||||
let response = Self::create_response(&metrics);
|
let response = Self::create_response(&metrics);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ impl PrometheusSync {
|
||||||
pub fn sync(self) -> JoinHandle<anyhow::Result<()>> {
|
pub fn sync(self) -> JoinHandle<anyhow::Result<()>> {
|
||||||
#[allow(unreachable_code)]
|
#[allow(unreachable_code)]
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let listener = TcpListener::bind("[::]:9500").await?;
|
let listener = TcpListener::bind("[::]:9091").await?;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let Ok((mut stream, _addr)) = listener.accept().await else {
|
let Ok((mut stream, _addr)) = listener.accept().await else {
|
||||||
|
|
Loading…
Reference in New Issue