Skip to content

openobserve/sample-tracing-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sample-tracing-rust

Rust tracing example

Build

Please update authorization, organization, and stream-name information in below function in main.rs, you can find this information by navigating OpenObserve UI to ingestion -> custom -> traces -> OTEL Collector.

fn otl_metadata() -> Result<MetadataMap, Error> {
    let mut map = MetadataMap::with_capacity(3);

    map.insert(
        "authorization",
        format!("Basic cm9vdEBleGFtcGxlLmNvbTprVUZ2SmpDYjRibjZMcUZo") // This is picked from the Ingestion tab OpenObserve
            .parse()
            .unwrap(),
    );
    map.insert("organization", "default".parse().unwrap());
    map.insert("stream-name", "default".parse().unwrap());
    Ok(map)
}

This sample program uses opentelemetry_otlp via grpc.

Run

cargo run

Collected in OpenObserve

The trace should be collected by OpenObserve and searchable as shown below image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages