aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/feeds.rs
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2020-10-02 18:36:57 -0400
committerGitHub <noreply@github.com>2020-10-02 18:36:57 -0400
commitfa13e57835e487d586024a2e065e8f4b30dc88cd (patch)
treee62623fec8d1f3e376453cb33ad0e42b2019b589 /src/handlers/feeds.rs
parenta6ee2e7e36e8e8fac6f7c5f452cd6a0a06790584 (diff)
downloadxesite-fa13e57835e487d586024a2e065e8f4b30dc88cd.tar.xz
xesite-fa13e57835e487d586024a2e065e8f4b30dc88cd.zip
incorporate tracing instead of log (#222)
* incorporate tracing instead of log * fix a test * fix a test
Diffstat (limited to 'src/handlers/feeds.rs')
-rw-r--r--src/handlers/feeds.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/handlers/feeds.rs b/src/handlers/feeds.rs
index 752b08c..2022393 100644
--- a/src/handlers/feeds.rs
+++ b/src/handlers/feeds.rs
@@ -1,7 +1,8 @@
use crate::{app::State, templates};
use lazy_static::lazy_static;
use prometheus::{opts, register_int_counter_vec, IntCounterVec};
-use std::{sync::Arc, io};
+use std::{io, sync::Arc};
+use tracing::instrument;
use warp::{http::Response, Rejection, Reply};
lazy_static! {
@@ -12,6 +13,7 @@ lazy_static! {
.unwrap();
}
+#[instrument(skip(state))]
pub async fn jsonfeed(state: Arc<State>) -> Result<impl Reply, Rejection> {
HIT_COUNTER.with_label_values(&["json"]).inc();
let state = state.clone();
@@ -26,6 +28,7 @@ pub enum RenderError {
impl warp::reject::Reject for RenderError {}
+#[instrument(skip(state))]
pub async fn atom(state: Arc<State>) -> Result<impl Reply, Rejection> {
HIT_COUNTER.with_label_values(&["atom"]).inc();
let state = state.clone();
@@ -41,6 +44,7 @@ pub async fn atom(state: Arc<State>) -> Result<impl Reply, Rejection> {
.map_err(warp::reject::custom)
}
+#[instrument(skip(state))]
pub async fn rss(state: Arc<State>) -> Result<impl Reply, Rejection> {
HIT_COUNTER.with_label_values(&["rss"]).inc();
let state = state.clone();
@@ -56,6 +60,7 @@ pub async fn rss(state: Arc<State>) -> Result<impl Reply, Rejection> {
.map_err(warp::reject::custom)
}
+#[instrument(skip(state))]
pub async fn sitemap(state: Arc<State>) -> Result<impl Reply, Rejection> {
HIT_COUNTER.with_label_values(&["sitemap"]).inc();
let state = state.clone();