fix(obs): fixed unresolved import super::local::ensure_dir_permissions (#2164)

This commit is contained in:
houseme
2026-03-15 00:33:06 +08:00
committed by GitHub
parent d3cff7d033
commit 7f3459f5a8
4 changed files with 19 additions and 26 deletions
+1 -5
View File
@@ -27,10 +27,6 @@
//! 7. Stdout worker guard — flushes buffered log lines written to stdout.
use opentelemetry_sdk::{logs::SdkLoggerProvider, metrics::SdkMeterProvider, trace::SdkTracerProvider};
#[cfg(unix)]
use pyroscope::PyroscopeAgent;
#[cfg(unix)]
use pyroscope::pyroscope::PyroscopeAgentRunning;
/// RAII guard that owns all active OpenTelemetry providers and the
/// `tracing_appender` worker guard.
@@ -46,7 +42,7 @@ pub struct OtelGuard {
/// Optional logger provider for OTLP log export.
pub(crate) logger_provider: Option<SdkLoggerProvider>,
#[cfg(unix)]
pub(crate) profiling_agent: Option<PyroscopeAgent<PyroscopeAgentRunning>>,
pub(crate) profiling_agent: Option<pyroscope::PyroscopeAgent<pyroscope::pyroscope::PyroscopeAgentRunning>>,
/// Handle to the background log-cleanup task; aborted on drop.
pub(crate) cleanup_handle: Option<tokio::task::JoinHandle<()>>,
/// Worker guard that keeps the non-blocking `tracing_appender` thread
+1 -2
View File
@@ -26,6 +26,7 @@
//! The function [`init_local_logging`] is the single entry point for both
//! cases; callers do **not** need to distinguish between stdout and file modes.
use super::guard::OtelGuard;
use crate::TelemetryError;
use crate::cleaner::LogCleaner;
use crate::cleaner::types::FileMatchMode;
@@ -50,8 +51,6 @@ use tracing_subscriber::{
util::SubscriberInitExt,
};
use super::guard::OtelGuard;
/// Initialize local logging (stdout-only or file-rolling).
///
/// When `log_directory` is empty or `None` in the config the function sets up
+4 -5
View File
@@ -32,12 +32,14 @@
//! All exporters use **HTTP binary** (Protobuf) encoding with **gzip**
//! compression for efficiency over the wire.
use crate::TelemetryError;
use crate::cleaner::types::FileMatchMode;
use crate::config::OtelConfig;
use crate::global::OBSERVABILITY_METRIC_ENABLED;
use crate::telemetry::filter::build_env_filter;
use crate::telemetry::guard::OtelGuard;
// Import helper functions from local.rs (sibling module)
use crate::TelemetryError;
use crate::telemetry::local::spawn_cleanup_task;
use crate::telemetry::recorder::Recorder;
use crate::telemetry::resource::build_resource;
use crate::telemetry::rolling::{RollingAppender, Rotation};
@@ -67,9 +69,6 @@ use tracing_subscriber::{
util::SubscriberInitExt,
};
// Import helper functions from local.rs (sibling module)
use super::local::{ensure_dir_permissions, spawn_cleanup_task};
/// Initialize the full OpenTelemetry HTTP pipeline (traces + metrics + logs).
///
/// This function is invoked when at least one OTLP endpoint has been
@@ -197,7 +196,7 @@ pub(super) fn init_observability_http(
}
// 2. Permissions
#[cfg(unix)]
ensure_dir_permissions(log_directory)?;
crate::telemetry::local::ensure_dir_permissions(log_directory)?;
// 3. Rotation
let rotation_str = config