Improve error logging and observability (#4443)

* Replace actix tracing with custom error tracing

* Fix logging

* wip: JSON logging

* Use LABRINTH_FORMAT to change to JSON output

* sqlx fix?

* CI fix

* Add tracing span info to HTTP requests

* Merge Result and Option error wrapping

* Add http.authorized to tracing
This commit is contained in:
aecsocket
2025-10-03 14:02:20 +01:00
committed by GitHub
parent 7e84659249
commit b96c5cd5ab
9 changed files with 326 additions and 31 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ use crate::{
use actix_web::{HttpRequest, HttpResponse, web};
use ariadne::ids::base62_impl::to_base62;
use chrono::{DateTime, Duration, Utc};
use eyre::eyre;
use serde::{Deserialize, Serialize};
use sqlx::PgPool;
use sqlx::postgres::types::PgInterval;
@@ -331,7 +332,7 @@ pub async fn revenue_get(
let duration: PgInterval = Duration::minutes(resolution_minutes as i64)
.try_into()
.map_err(|_| {
ApiError::InvalidInput("Invalid resolution_minutes".to_string())
ApiError::Request(eyre!("Invalid `resolution_minutes`"))
})?;
// Get the revenue data
let project_ids = project_ids.unwrap_or_default();