#open-telemetry #logging-tracing #tracing #metrics #newrelic #logging

easy_init_newrelic_opentelemetry

A simple example of how to initialize a newrelic opentelemetry exporter

4 releases

0.2.0 Oct 23, 2024
0.1.2 Feb 1, 2024
0.1.1 Jan 31, 2024
0.1.0 Jan 31, 2024

#2 in #newrelic

Download history 15/week @ 2024-07-23 1/week @ 2024-09-17 22/week @ 2024-09-24 9/week @ 2024-10-01 2/week @ 2024-10-15 191/week @ 2024-10-22 56/week @ 2024-10-29 26/week @ 2024-11-05

275 downloads per month

MIT license

17KB
287 lines

Easy Init NewRelic OpenTelemetry

This crate provides a subscriber for OpenTelemetry that sends spans and metrics to New Relic.

Example

use easy_init_newrelic_opentelemetry::NewRelicSubscriberInitializer;
use time::macros::offset;

fn main() {
    NewRelicSubscriberInitializer::default()
        .newrelic_otlp_endpoint("http://localhost:4317")
        .newrelic_license_key("1234567890abcdef1234567890abcdef12345678")
        .newrelic_service_name("test-service")
        .host_name("test-host")
        .timestamps_offset(offset!(+00:00:00));
}

lib.rs:

New Relic OpenTelemetry Subscriber

This crate provides a subscriber for OpenTelemetry that sends spans and metrics to New Relic.

Example

use easy_init_newrelic_opentelemetry::NewRelicSubscriberInitializer;
use time::macros::offset;

NewRelicSubscriberInitializer::default()
            .newrelic_otlp_endpoint("http://localhost:4317")
            .newrelic_license_key("1234567890abcdef1234567890abcdef12345678")
            .newrelic_service_name("test-service")
            .host_name("test-host")
            .timestamps_offset(offset!(+00:00:00));

Dependencies

~24–38MB
~666K SLoC