diff --git a/nr-tracing-layer/README.md b/nr-tracing-layer/README.md index ae2d448..824c43a 100644 --- a/nr-tracing-layer/README.md +++ b/nr-tracing-layer/README.md @@ -1,20 +1,19 @@ -# dd-tracing-layer +# nr-tracing-layer -[![license](https://img.shields.io/crates/l/dd-tracing-layer?style=for-the-badge)](https://github.com/robertohuertasm/log-tracing-layer/blob/master/LICENSE) -[![crates.io](https://img.shields.io/crates/v/dd-tracing-layer?style=for-the-badge)](https://crates.io/crates/dd-tracing-layer) -[![docs.rs](https://img.shields.io/docsrs/dd-tracing-layer?style=for-the-badge)](https://docs.rs/dd-tracing-layer) +[![license](https://img.shields.io/crates/l/nr-tracing-layer?style=for-the-badge)](https://github.com/robertohuertasm/log-tracing-layer/blob/master/LICENSE) +[![crates.io](https://img.shields.io/crates/v/nr-tracing-layer?style=for-the-badge)](https://crates.io/crates/nr-tracing-layer) +[![docs.rs](https://img.shields.io/docsrs/nr-tracing-layer?style=for-the-badge)](https://docs.rs/nr-tracing-layer) -A [tracing layer](https://tokio.rs/tokio/topics/tracing) that sends logs to the [Datadog Log API](https://docs.datadoghq.com/api/latest/logs/?code-lang=typescript#send-logs). +A [tracing layer](https://tokio.rs/tokio/topics/tracing) that sends logs to the [New Relic Log API](https://docs.newrelic.com/docs/logs/get-started/get-started-log-management/). -It's mainly useful when you don't have access to your infrastructure and you cannot use the [Datadog Agent](https://docs.datadoghq.com/agent/) or any [other mean](https://docs.datadoghq.com/logs/log_collection/?tab=host#setup). ## Requirements -You'll need a [Datadog API Key](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys) for everything to work. +You'll need a [New Relic API Key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/) for everything to work. ## Endpoint -This crate uses the `v2` logs endpoints and, by default, will try to send the logs to the `US1` region. +By default, will try to send the logs to the `US1` region. You can easily change the region or provide a custom URL if needed. @@ -23,9 +22,9 @@ You can easily change the region or provide a custom URL if needed. Here's a simple example of how to set it up and use it: ```rust -use dd_tracing_layer::DatadogOptions; +use nr_tracing_layer::NewRelicOptions; use tracing_subscriber::prelude::*; -use tracing::{instrument, subscriber}; +use tracing::{instrument, subscriber} #[instrument] fn log(msg: &'static str) { @@ -33,9 +32,9 @@ fn log(msg: &'static str) { } fn main() { - let options = DatadogOptions::new("my-service", "my-datadog-api-key") + let options = NewRelicOptions::new("my-service", "my-new-relic-api-key") .with_tags("env:dev"); - let dd = dd_tracing_layer::create(options); + let dd = nr_tracing_layer::create(options); let subscriber = tracing_subscriber::registry() .with(tracing_subscriber::fmt::Layer::new().json()) .with(dd); diff --git a/nr-tracing-layer/src/lib.rs b/nr-tracing-layer/src/lib.rs index 71db2a7..cb661ea 100644 --- a/nr-tracing-layer/src/lib.rs +++ b/nr-tracing-layer/src/lib.rs @@ -1,11 +1,9 @@ -//! A tracing layer that sends logs to [New Relic](https://docs.datadoghq.com/api/latest/logs/?code-lang=typescript#send-logs). -//! -//! It's mainly useful when you don't have access to your infrastructure and you cannot use the [Datadog Agent](https://docs.datadoghq.com/agent/) or any [other mean](https://docs.datadoghq.com/logs/log_collection/?tab=host#setup). +//! A tracing layer that sends logs to [New Relic](https://docs.newrelic.com/docs/logs/get-started/get-started-log-management/). //! //! ## Example //! //! ```rust -//! use dd_tracing_layer::DatadogOptions; +//! use nr_tracing_layer::NewRelicOptions; //! use tracing_subscriber::prelude::*; //! use tracing::{instrument, subscriber}; //! @@ -15,9 +13,9 @@ //! } //! //! fn main() { -//! let options = DatadogOptions::new("my-service", "my-datadog-api-key") +//! let options = NewRelicOptions::new("my-service", "my-new-relic-api-key") //! .with_tags("env:dev"); -//! let dd = dd_tracing_layer::create(options); +//! let dd = nr_tracing_layer::create(options); //! let subscriber = tracing_subscriber::registry() //! .with(tracing_subscriber::fmt::Layer::new().json()) //! .with(dd); @@ -27,12 +25,10 @@ //!``` mod new_relic_ingestor; -// TODO: (ROB) fix the documentation of the module - pub use log_tracing_layer::LogLayer; pub use new_relic_ingestor::{NewRelicOptions, Region}; -/// Creates a log layer that will send logs to Datadog +/// Creates a log layer that will send logs to New Relic. #[must_use] pub fn create(options: NewRelicOptions) -> LogLayer { let ingestor = new_relic_ingestor::NewRelicLogIngestor::new(options); diff --git a/nr-tracing-layer/tests/new_relic.rs b/nr-tracing-layer/tests/new_relic.rs index cba6d4d..830383f 100644 --- a/nr-tracing-layer/tests/new_relic.rs +++ b/nr-tracing-layer/tests/new_relic.rs @@ -88,7 +88,7 @@ mod tests { } #[test] - // #[ignore] + #[ignore] fn nr_manual_tests_without_mock_server() { // set up dotenvy::from_filename(".env").ok();