1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-08-30 02:59:20 +02:00

Remove once_cell dependency

This commit is contained in:
Luca Palmieri
2024-09-02 11:21:47 +02:00
parent 9f180d6eb9
commit f9c81facb2
4 changed files with 6 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
use actix_web::{web, App, HttpServer};
use once_cell::sync::Lazy;
use opentelemetry::trace::TracerProvider;
use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::WithExportConfig;
@@ -8,14 +7,15 @@ use opentelemetry_sdk::{
};
use opentelemetry_semantic_conventions::resource;
use std::io;
use std::sync::LazyLock;
use tracing_actix_web::TracingLogger;
use tracing_bunyan_formatter::{BunyanFormattingLayer, JsonStorageLayer};
use tracing_subscriber::{layer::SubscriberExt, EnvFilter, Registry};
const APP_NAME: &str = "tracing-actix-web-demo";
static RESOURCE: Lazy<Resource> =
Lazy::new(|| Resource::new(vec![KeyValue::new(resource::SERVICE_NAME, APP_NAME)]));
static RESOURCE: LazyLock<Resource> =
LazyLock::new(|| Resource::new(vec![KeyValue::new(resource::SERVICE_NAME, APP_NAME)]));
async fn hello() -> &'static str {
"Hello world!"