-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fdcaa5
commit e8614ae
Showing
10 changed files
with
201 additions
and
80 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ members = [ | |
resolver = "2" | ||
|
||
[workspace.package] | ||
rust-version = "1.72.0" | ||
edition = "2021" | ||
authors = [ "Heiko Seeberger <[email protected]>" ] | ||
license = "Apache-2.0" | ||
|
@@ -27,6 +26,7 @@ opentelemetry-otlp = { version = "0.12", default-features = false, features = | |
prost = { version = "0.11" } | ||
serde = { version = "1.0", features = [ "derive" ] } | ||
serde_json = { version = "1.0" } | ||
time = { version = "0.3", features = [ "formatting" ] } | ||
tokio = { version = "1", features = [ "macros", "rt-multi-thread", "signal" ] } | ||
tokio-stream = { version = "0.1", features = [ "fs" ] } | ||
tonic = { version = "0.9" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
use serde_json::json; | ||
use std::fmt::Display; | ||
use time::{format_description::well_known::Rfc3339, OffsetDateTime}; | ||
|
||
pub mod otel; | ||
pub mod tracing; | ||
|
||
pub fn log_error(error: impl Display) { | ||
let now = OffsetDateTime::now_utc().format(&Rfc3339).unwrap(); | ||
let error = serde_json::to_string(&json!({ | ||
"timestamp": now, | ||
"level": "ERROR", | ||
"message": "process exited with ERROR", | ||
"error": format!("{error:#}") | ||
})); | ||
// Not using `eprintln!`, because `tracing_subscriber::fmt` uses stdout by default. | ||
println!("{}", error.unwrap()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../hello-tracing-backend/proto/ | ||
../hello-tracing-backend/proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters