rs-zero 0.2.2

Rust-first microservice framework inspired by go-zero engineering practices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use rs_zero::observability::{OtlpTraceConfig, TraceShutdownHandle, build_otlp_trace_config};

#[test]
fn otlp_config_and_shutdown_handle_are_testable_without_collector() {
    let mut config = OtlpTraceConfig::default();
    config
        .resource
        .insert("service.name".to_string(), "rs-zero-test".to_string());
    let config = build_otlp_trace_config(config).expect("config");
    assert_eq!(config.resource["service.name"], "rs-zero-test");

    let handle = TraceShutdownHandle::installed();
    handle.flush().expect("flush");
    handle.shutdown().expect("shutdown");
}