generated from Patagia/template-nix
parent
441c38b3d5
commit
b1f701ddf2
7 changed files with 175 additions and 140 deletions
controller/src
|
@ -14,12 +14,15 @@ use patagia_controller::context::ControllerContext;
|
|||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Cli {}
|
||||
struct Cli {
|
||||
#[arg(long = "telemetry-otlp-endpoint", default_value = "http://localhost:4317", value_name = "OTEL_EXPORTER_OTLP_ENDPOINT")]
|
||||
otlp_endpoint: Option<String>,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let _args = Cli::parse();
|
||||
let _tracing = instrumentation::init_tracing_subscriber()?;
|
||||
let args = Cli::parse();
|
||||
let _tracing = instrumentation::init_tracing(args.otlp_endpoint.as_ref())?;
|
||||
|
||||
tracing::info!("Patagia Controller");
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ pub(crate) async fn version(
|
|||
|
||||
tracing::info_span!("Hello, span!");
|
||||
|
||||
tracing::info!(monotonic_counter.version_calls = 1);
|
||||
|
||||
async move {
|
||||
tracing::info!("Someone made a request to /version");
|
||||
tokio::time::sleep(std::time::Duration::from_millis(200)).await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue