newrelic-unofficial-rust

It's an unofficial port of the New Relic Go agent to Rust.

Unlike the one based on the C sdk, it is completely thread-safe and works alone.

Status

The library reports itself as Go because the New Relic server (of course) doesn't have a support for Rust.

Usage

Application setup:

```rust // Set up NewRelic in-process daemon (newrelicunofficial::Daemon). // Generate Daemon at application startup and keep it until application shutdown. let license = std::env::var("NEWRELICLICENSEKEY").unwrap(); let daemon = Daemon::new("rust-test", &license).unwrap();

// Get application handle (newrelic_unofficial::Application) from the daemon. // Pass it around to record application events. let app = daemon.application().clone(); ```

Transaction:

```rust // Start a new (non-web) transaction. // The end of the transaction is automatically recorded on drop. let txn = app.start_transaction("SomeBackgroundJob");

// Or you can start a web transaction. let txn = app.startwebtransaction("/upload", http_request); ```

Segment: not yet implemented

License

I consider it a port of the New Relic Go agent, therefore (perhaps) inheriting copyrights from the original source code.

Licensed under Apache-2.0