Telegram Group & Telegram Channel
Использование OpenTelemetry в Rust

В статье рассмотрено, как использовать OpenTelemetry в Rust для мониторинга и трассировки приложений. OpenTelemetry — это мощный инструмент для сбора и анализа данных о производительности, который помогает отслеживать выполнение запросов в распределенных системах.

В статье показано, как интегрировать OpenTelemetry в приложение на Rust, используя библиотеку tracing и экспортировать данные в Jaeger. Приведены примеры кода, объясняющие настройку и использование трейсов для диагностики проблем и улучшения производительности.

Базовый конвейер с OpenTelemetry можно настроить с помощью opentelemetry_otlp. Затем создаётся слой tracing_opentelemetry, использующий этот конвейер, и добавляется в подписчик трассировки, который инициализируется.


// note that here, localhost:4318 is the default HTTP address
// for a local OpenTelemetry collector
let tracer = opentelemetry_otlp
::new_pipeline()
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().http().with_endpoint("localhost:4318"))
.install_batch(Tokio)
.unwrap();

// log level filtering here
let filter_layer = EnvFilter::try_from_default_env()
.or_else(|_| EnvFilter::try_new("info"))
.unwrap();

// fmt layer - printing out logs
let fmt_layer = fmt::layer().compact();

// turn our OTLP pipeline into a tracing layer
let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer);

// initialise our subscriber
subscriber
.with(filter_layer)
.with(fmt_layer)
.with(otel_layer)
// The error layer needs to go after the otel_layer, because it needs access to the
// otel_data extension that is set on the span in the otel_layer.
.with(ErrorTracingLayer::new())
.init();


https://shuttle.rs/blog/2024/04/10/using-opentelemetry-rust

👉 @rust_lib



tg-me.com/rust_lib/226
Create:
Last Update:

Использование OpenTelemetry в Rust

В статье рассмотрено, как использовать OpenTelemetry в Rust для мониторинга и трассировки приложений. OpenTelemetry — это мощный инструмент для сбора и анализа данных о производительности, который помогает отслеживать выполнение запросов в распределенных системах.

В статье показано, как интегрировать OpenTelemetry в приложение на Rust, используя библиотеку tracing и экспортировать данные в Jaeger. Приведены примеры кода, объясняющие настройку и использование трейсов для диагностики проблем и улучшения производительности.

Базовый конвейер с OpenTelemetry можно настроить с помощью opentelemetry_otlp. Затем создаётся слой tracing_opentelemetry, использующий этот конвейер, и добавляется в подписчик трассировки, который инициализируется.


// note that here, localhost:4318 is the default HTTP address
// for a local OpenTelemetry collector
let tracer = opentelemetry_otlp
::new_pipeline()
.tracing()
.with_exporter(opentelemetry_otlp::new_exporter().http().with_endpoint("localhost:4318"))
.install_batch(Tokio)
.unwrap();

// log level filtering here
let filter_layer = EnvFilter::try_from_default_env()
.or_else(|_| EnvFilter::try_new("info"))
.unwrap();

// fmt layer - printing out logs
let fmt_layer = fmt::layer().compact();

// turn our OTLP pipeline into a tracing layer
let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer);

// initialise our subscriber
subscriber
.with(filter_layer)
.with(fmt_layer)
.with(otel_layer)
// The error layer needs to go after the otel_layer, because it needs access to the
// otel_data extension that is set on the span in the otel_layer.
.with(ErrorTracingLayer::new())
.init();


https://shuttle.rs/blog/2024/04/10/using-opentelemetry-rust

👉 @rust_lib

BY Rust




Share with your friend now:
tg-me.com/rust_lib/226

View MORE
Open in Telegram


Rust Telegram | DID YOU KNOW?

Date: |

Importantly, that investor viewpoint is not new. It cycles in when conditions are right (and vice versa). It also brings the ineffective warnings of an overpriced market with it.Looking toward a good 2022 stock market, there is no apparent reason to expect these issues to change.

Telegram hopes to raise $1bn with a convertible bond private placement

The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.

Rust from ca


Telegram Rust
FROM USA