MCPcopy Create free account
hub / github.com/hashintel/hash / init_tracing

Function init_tracing

libs/@local/telemetry/src/lib.rs:283–294  ·  view source on GitHub ↗

Initialize the `tracing` logging setup. # Errors - [`InitTracingError`], if initializing the [`tracing_subscriber::Registry`] fails.

(
    config: TracingConfig,
    service_name: &'static str,
)

Source from the content-addressed store, hash-verified

281///
282/// - [`InitTracingError`], if initializing the [`tracing_subscriber::Registry`] fails.
283pub fn init_tracing(
284 config: TracingConfig,
285 service_name: &'static str,
286) -> Result<impl Drop, Report<InitTracingError>> {
287 TelemetryRegistry::default()
288 .with_error_layer()
289 .with_console_logging(config.logging.console)
290 .with_file_logging(config.logging.file)
291 .with_sentry(config.sentry)
292 .with_otlp(config.otlp, service_name)
293 .init_global()
294}

Callers 3

block_onFunction · 0.50
runMethod · 0.50
mainFunction · 0.50

Calls 7

init_globalMethod · 0.80
with_otlpMethod · 0.80
with_sentryMethod · 0.80
with_file_loggingMethod · 0.80
with_console_loggingMethod · 0.80
with_error_layerMethod · 0.80
defaultFunction · 0.50

Tested by

no test coverage detected